Handy unix commands
Useful commands to help you manage the linux command line.
"man" is the command you issue to see the "man"ual for a given command. Type man <command> to see how to properly use it and what options are available to help you make use of the given command.
List contents of current folder.
Go from one directory to another. Usage: cd <dir>
Find your current working folder.
Create a new directory in the current folder.
rmDelete a file or folder
Copy a file or folder from one location to another. Usage: cp <file1> <file2>
mvMove a file or folder from one location to another. Usage: mv <file1> <file2>
Create a new empty file. Usage: touch <file>
Output the contents of a file with page breaks.
See the last few lines of a file.
A useful command to help you search for a string or pattern within a file.
grep "example" results.txt
A powerful command to search for files and directories.
To find all ".doc" files: find . -name '*.doc' To find all files owned by user "jane": find . -user jane To find all files modified within the last 24 hours: find . -mtime 1
Count the number of files
This counts all doc files in the current directory and its subfolders ...
find . -name '*.doc' | wc -l
Create a symbolic link
While in your home directory issue this command to allow you to go to /nfs/data/project/xn8thesis by clicking on the Thesis symbolic link in your home directory. :
ln -s /nfs/data/project/xn8thesis Thesis