Unix Commands - Beginning Flashcards
kernel
manages processes, devices, and memory.
shell
interface between kernel and user. interpreter of commands.
file system
hierarchy of directories, subdirectories and files.
standard input
what user types.
standard output
resulting text from the process of a command.
passwd
command for password. password is not visible in shell. login is lowercase. commands are case sensitive.
logout
ends session
pwd
print working directory. shows pathway of current directory.
cd
change directory. can accept argument.
flags
single letter abbreviations that modify commands.
arguments
typically file names input after a command.
ls
lists directories and all files. -a lists all entries.
-l (lowercase L)
prints list in long format. gives mode, links. owner, size and time of last mod.
-F
visualization of contents being linked. these are / after names of directories. * is executable file. @ is link.
-1 (number one)
prints each file name on separate line.
-d
lists directory names without contents
-h
human readable. prints sizes in easy formats. flags do not require arguments and can be input together.
mkdir
make directory. argument is required. needs to know name of directory to create.
-p
parent. creates all files in directory that do not yet exist.
-cat
concatenate - writes the specified file as argument to standard output.
more [file]
writes the specified file as an argument to std output one screen at a time.
head [count] [file]
prints a certain number of lines from the specified output file. if not specified then standard number is ten.
tail [-f] [-c number] [-n number]
prints the lines of a specified file beginning at a certain place. if no flags are indicated, then default is ten lines.
sort
sorts files based on sorting criteria. ordered in ascending order as default. -r for reverse sorting. -n sorts lines numerically.
move file1 [file2] target
moves the file to the location specified at target.
copy file1 [file2]
copies the files to one target.
grep [c] [-n] [file]
searches titles for a pattern. and prints lines containing the pattern.
- c is number of lines containing pattern.
- n prints out line number where the file is found.
alias [alias_namestring}
defines aliases which are set when a command is used often or is very long. alias_name sets new name for the command. the original name must be entered in quotation marks.
unalias
alias-name removes alias definition. -a will remove all aliases assigned in the session.
echo [n] [arg]
writes arguments separated by blanks and terminated by a new line. a single echo command prints the line to standard output.
wc
word count.
[-c | m] [-lw] will count the number of words, lines, characters in a file. -1 counts lines in a file.
ln [-sif] file1 [file2] target
links files together. if user wants to access a file in another directory that may be too large to copy, the files may be linked.
rm
removes files. YOU CANNOT RETRIEVE FILES ONCE REMOVED.
man
prints out description of a commands, its uses, and syntax.
apropos [keyword]
prints out list of commands containing the keyword in their description. this is used when you don’t know what command to use for a particular job.