Basic Ubuntu Commands for beginners:
1. sudo
sudo (SuperUser DO) Linux command allows you to run programs or commands with administrative privileges, like we have “Run as administrator” in Windows. This is useful when, for example, you need to modify files in a directory that your user wouldn’t normally have access to.
2. date
date command displays the current date and time(including day of the week and time zone).
3. apt-get
apt-get is the one of the most important Ubuntu commands every beginner must know. It is used to install, update, upgrade and remove any package. Here is the list of different apt-get commands:
apt-get update with super user (root) privileges is the first command you need to run in any Linux system after installation. This command scans the database and let you know if there are newer packages available or not.
After updating the package database, next step is to upgrade the installed packages. For upgrading all the packages with available updates you can use this command.
And if you like to upgrade a particular package, you should use this command,
sudo apt-get upgrade <package-name>
[Replace the <package-name> with your desired package.]
If you know the package name, then you can use this command
,
sudo apt-get install <package-name>
4. ls
ls (list) command lists all the files and folders available in a particular directory.
5. pwd
pwd (print working directory) Ubuntu command shows the full path of the current working directory.
6. useradd
useradd Ubuntu command is used to add a new user in the system.
It is easy to add a new user by using this command, useradd <user_name>
7. passwd
passwd Ubuntu command is used to set password to the new user. This Linux command is also used to change the password of the existing user, also helpful in case if you forgot your user's account password.
To change/set the user password use, passwd <user_name>
Be careful while changing user password, as if you forgot to type <user_name> and run command by entering passwd then your root account password will change, which is not a good practise.
8. cd
cd (change directory) Linux command also known as chdir used to change the current working directory. It is one of the most used and most basic Ubuntu commands. This command is easy to use, just type cd followed by the the folder name, cd <folder_name>
If you want to go to previous directory, then use cd ..
If you want to go to root directory, then use cd /
9. mkdir
mkdir Ubuntu command is used to create a new directory in the current working directory. If you want to create a new directory at a particular location then you can specify the path.
To use this command enter, mkdir <directory_name>
10. rmdir
rmdir (remove directory) command removes the specified directory.
To remove directory use, rmdir <diectory_name>
If you want to remove a specific file then use, rm <file_name>
rm -r command removes the directory along with its content (files and folders stored in that directory). So to remove a directory with its content use, rm -r <dir_name>
Comments
Post a Comment