120 likes | 150 Views
Useful Linux Commands. cd ( C hange D irectory) . Enables you to navigate to another directory Example: cd Downloads Example: cd /etc/ Example: cd .. (Directory up!)
E N D
cd (Change Directory) • Enables you to navigate to another directory • Example: cdDownloads • Example: cd/etc/ • Example: cd.. (Directory up!) • note: After you have typed cd and entering the first or two letters of the directory you can press the TAB key to auto-complete the directory!
man ( Manual Page) • Shows the "manual" of the command for detailed explanation. • In some situation you might need to get more information about the command you are using. • The man command shows you this information about the command. • Example: mancp
ls ( List directory contents ) • Used to list the files/directories within a directory. • Example: ls • It shows the directories available. Can use -al argument to list hidden files and permissions for each directory/file.
cp ( Copy ) • The cp command is available for us to duplicate files; • Example: cpfile1file2 • note:file1 is the file the user wants to be copied... file2 is the name of the copied file (new file/destination file).
mv (Move) • Enables the users to move a file/directory to a specified location. • Example: • mv/home/me/Desktop/src /home/me/Desktop/dst • note: The first part of the command is the file that has to be moved. The second part (after the whitespace) is the target directory.
rmdir ( Remove Directory) • Removing directories is done by the rmdir command • Example: rmdirfolder • note: When the directory is not empty the command will give an error message: • rmdir: failed to remove `folder': Directory not empty • So, make sure folder is completely empty before removing it.
touch • The touch command is used to make files. • Example: touchvogel • This will create the file vogel for us in the current working directory.
rm ( Remove) • The rm command is used to delete files instead of directories. • Example: rmvogel • note: To remove files you must have the right permission bits set on the specific file.
pwd (Print Working Directory) • Sometimes you really wonder which directory you are in. PWD is the solution for that problem. • Example: pwd
gcc • Compile a c program into an executable • gcc –o exefile file.c • exefile is executable file to be created • file.c is the c file to be compiled
xemacs • Editor for working with a variety of file types including c files • It has a Graphical User Interface • xemacs file1.c