File Commands Unix/ Linux

cd (directory name) – change directory to directory you would like.
cd – change to home.
pwd – show current directory.
mkdir (directory name) – create a directory with the name..
rm (filename) – delete a file with the name..
rm -r (directory name) – delete directory with the name..
rm -f (file name) – force remove file with the name..
rm -rf (directory name) – force remove directory with the name.. (EXTREME CAUTION)
cp (filename1) (filename2) – copy file1 to file2
cp -r (dir1) (dir2) – copy dir1 to dir2; create dir2 if it doesn’t exist.
mv (file1) (file2) – rename or move file1 to file2 if file2 is an existing directory, moves file1 into directory file2.
ln -s (filename) (link) – create symbolic link link to file.
touch (filename) – create or update file with the name..
cat > (filename) – places standard input into file with the name..
more (filename) – output the contents of a file.
head (filename) – output the first 10 lines of file with the name..
tail (filename) – output the last 10 lines of file with the name..
tail -f (filename) – output the contents of file as it grows, starting with the last 10 lines.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s