Professional Documents
Culture Documents
Sorts the contents of the input file in Sorts the contents of names
sort infile sort names
alphabetical order alphabetical order
who am i
who am I Tells you your user information None
whoami
echo whatever I type Writes whatever I type to the screen. echo hey you! Writes hey you! to the screen
Does the same thing as echo only in Writes hey! in large letters o
banner big words banner hey!
BIG words the screen
Prints the first 10 lines of the file to Prints the first 10 lines of
head file head addresses
the screen addresses to the screen
Prints the last 10 lines of the file to Prints the last 10 lines of
tail file tail test.txt
the screen test.txt to the screen
Q quits
Lists all the nonhidden files and Lists all nonhidden files and
ls (-option-optional) ls
directories directories in the current directo
Important Characters
| ls -l | more Lists your files in long format
“pipe” directs the output of the
one screen at a time
first command to the input of
> ls -l > Prints your listing to a file name
another.
myfiles myfiles
Sends the output of a command to
>> Appends your filenames to the
a designated file
ls -l >> end of the allfiles file
Appends the output of a command
& allfiles Runs xclock (a clock) allowing
to a designated file
you to keep working
Runs command in the background; xclock &
you can still work in the window Writes your home directory to t
~
Designates the home directory echo ~ screen
($HOME) progA program gets its input
<
Designates input from somewhere progA < from a file named input1
other than terminal input1
rm file1 file2
Removes (deletes) file(s) rm xyz Deletes a file named xyz
file3
Deletes everything
rm *
nonhidden
Shows all processes that are Shows all the processes that
ps -u user_id owned by the person with the ps -u bob belong to the person with the
pertinent user_id userid bob
grep -v string All lines that do not match are Prints all lines in pencils that
grep -v lead pencils
file printed not contain the string lead
compress filename Compresses the file to save disk space. none None
uncompress
Expands a compressed file none None
filename
assign read-only
chmod [options] Change the access mode (permissions) of chmod -r file
permission to file for
mode files one or more files
everyone
1
Workshop on Linux SCET