Display the current working directory |
pwd |
Change to my home directory |
cd |
Change directory up a level |
cd .. |
Change directory down a level into dir |
cd dir |
Create a new subdirectory dir |
mkdir dir |
Remove an empty subdirectory dir |
rmdir dir |
List all the files in the current directory |
ls |
List only the files here with names starting with 'a' |
ls a* |
List only the files here with names ending with '.c' |
ls *.c |
List all the files in directory dir |
ls dir |
Make a copy of file source and name it dest |
cp source dest |
Change the name of file source to dest |
mv source dest |
Change the name of directory source to dest |
mv source dest |
Move the file file to directory dir |
mv file dir |
Remove the file file |
rm file |
Remove all the files ending in '.txt' in interactive mode |
rm -i *.txt |
Remove all the files in the current directory in interactive mode |
rm -i * |
Display all the command line arguments |
echo |
Show what type of file file is |
file file |
Show how many lines, words and characters there are in file |
wc file |
Display all the text in file file |
cat file |
Concatenate all the text in files file1, file2, file3 |
cat file1 file2 file3 |
Interactively browse through the text in file file |
less file |
Display the top several lines in file file |
head file |
Display the bottom several lines in file file |
tail file |
Display the lines of file file that contain word |
grep word file |
Show the current date and time |
date |
Browse the manual for command name |
man name |
Run shell commands from file file |
source file |
List the files packed in a tar archive file |
tar -tf file |
Unpack all files in a tar archive file into the current directory |
tar -xf file |
Start an interactive gnuplot process |
gnuplot |
Compile C source file file.c into executable file file |
gcc file.c -o file |
Terminate shell and close terminal |
exit |