Friday, 13 March 2015

Basic Linux Commands For Beginners


"Under Linux there are GUIs (graphical user interfaces), where you can point and click and drag, and hopefully get work done without first reading lots of documentation. The traditional Unix environment is a CLI (command line interface), where you type commands to tell the computer what to do. That is faster and more powerful, but requires finding out what the commands are." 

Here I have listed some of the basic commands that are useful if you are a newbie to Linux.

1. pwd : The pwd command will allow you to know in which directory you're located (pwd stands for "print working directory").

2. ls : The ls command will show you ('list') the files in your current directory.

3. cd: The cd command will allow you to change directories.

4. cp: The cp command will make a copy of a file for you.

5. rm: Use this command to remove or delete a file in your directory.

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

Example : rm -rf filename

7. mkdir: The mkdir command will allow you to create directories. 

Example: "mkdir nabin" will create a directory called "nabin".

8. df: Check the amount of free disk space on the filesystems.

9. chmod : Changing a file’s permissions.

Example: chmod 777 filename

10. chown : Changing the owner and owning group of files.

Example: chown nabin file.txt (Set the owner of file file.txt to user nabin)

11. cp: Copy files and directories

Example: cp /root/file /tmp/ (copy of ‘file’ located in the ‘/root’ directory to the ‘/tmp’ directory)

12. mv: The mv command will move a file to a different location or will rename a file.

13. passwd : change the password of the current user

14. sudo: The sudo command is used to perform file operations on files that the Root User would only be allowed to change. 

15. man: The man command is used to show you the manual of other commands.

No comments:

Post a Comment