The useful commands for linux users (part I)

This blog gives an introduction to using the basic command line interface terminal. In order to work with file and directory effectively, I hope this blog is helpful for users who use Linux.

1. pwd (print working directory): The pwd command allow you to know in which directory you're located. Example: "pwd" in the Desktop directory will show "~/Desktop".
2. sudo (superuser do): the sudo command  allows a permitted user to execute a command as the superuser or another user, as specified in thesudoers file.

3. cd: The cd command will allow you to change directories. 
  • "cd/" to navigate into the root directory
  • "cd" or "cd ~" to navigate to your home directory
  • "cd .." to navigate up one directory level
  • "cd -" to navigate (or back) to the previous directory
4. ls: The ls command will list the files in your current directory.
  • "ls -l" display information of files/directories, time created, adminitration of these files/directories
  • "ls -a" display list of files, hidden directories in the current directory
5. cp (copy):  The cp command will make a copy of a file for you. 
  • "cp scuti blog" will make an cope of file "scuti" and name it "blog", but the file "scuti" will still be there.
  • If you want to cope a directory, use "cp -a /path/from /path/to"
6. mv (move): The mv command will move a file to a different location or will rename a file.
  • "mv scuti asia" will rename the file "scuti" to "asia"
  • "mv scuti ~/Desktop" will move the file "scuti" to your Desktop directory, but it will not rename it. You must specify a new file name to rename a file.
7. rm (remove): Use this command to remove or delete a file in your directory.

8. rmdir (remove directory):  The rmdir command will delete an empty directory. To delete a directory and all of its contents recursively, use rm -r instead.

9. history: Display all of the previous commands you typed.

10. mkdir (make directory): This command allows you to make new directories. Example: "mkdir cookstar" will create a directory called "cookstar".
If you liked this article

Let's subscribe the updates of Scuti!
Share on Google Plus

About Quang Hoan

This is a short description in the author block about the author. You edit it by entering text in the "Biographical Info" field in the user admin panel.
    Blogger Comment
    Facebook Comment


Post a Comment