The following are a list of useful Linux Commands that you may want to use during the course.
CAPITALIZED items should be replaced with those described. [Bracketed] items are optional. When in doubt, use ‘man’ to learn more about each command.
Command | What it does |
---|---|
man COMMAND |
Show manual for command |
passwd |
Changes your password |
pwd |
Prints the current (working) directory |
ls [-la] |
Lists files in the current directory. -la lists all (including hidden) files |
cd DIRECTORY |
Change your current directory |
gedit [FILE] |
Opens text editor, or a specific file in the editor |
cp SOURCE DEST |
Copy a file or directory from the SOURCE location to the DEST location |
mv SOURCE DEST |
Move a file or directory from the SOURCE location to the DEST location |
rm NAME |
Remove a file |
mkdir NAME |
Make a new directory |
rmdir DIRECTORY |
Remove a directory (must be empty) |
python [FILE.py] |
Open the python interpreter, or runs a specific python file |
cat FILE |
Print contents of FILE |
less FILE |
Display contents of FILE |
grep PATTERN FILE |
Looks for PATTERN in FILE |
grep -n PATTERN FILE |
Looks for PATTERN in FILE and displays the line number |
diff FILE1 FILE2 |
Shows the differences between FILE1 and FILE2 |
script FILE |
Records everything printed to our screen, Saved to FILE |
lpr FILE |
Prints FILE to the undergraduate printers [More Info] |
lpinfo |
Displays your print status and quota |
wc [-cml] |
word count (displays count of lines, words and characters in FILE) |
uniq [-cduf] FILE |
Filter out repeated lines in FILE |
sort [-bfnr] FILE |
Sort the lines in FILE |
cut [-bf] FILE |
Cut out selected field/bytes of each line in a file |
head [-n NUM] |
Displays the first ten lines of FILE, unless specified with -n NUM |
tail [-n NUM] |
Displays the last ten lines of FILE, unless specified with -n NUM |