1 / 12

Useful Linux Commands

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!)

magdalenas
Download Presentation

Useful Linux Commands

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Useful Linux Commands

  2. 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!

  3. 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

  4. 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.

  5. 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).

  6. 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.

  7. 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.

  8. touch • The touch command is used to make files. • Example: touchvogel • This will create the file vogel for us in the current working directory.

  9. 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.

  10. pwd (Print Working Directory) • Sometimes you really wonder which directory you are in. PWD is the solution for that problem. • Example: pwd

  11. 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

  12. xemacs • Editor for working with a variety of file types including c files • It has a Graphical User Interface • xemacs file1.c

More Related