Being as a sever administrator or DevOps engineer or DBA, you must know all basic linux commands. Here I am going to tell you all basic linux commands which you must know if you are thinking to work on Linux as your primary operating system.
mkdir will create a new folder in current directory.
cp command will copy and paste your file/folder to destination directory.
cp targetFile/ PathToDestinationFolder/
If you have to copy a directory(folder) then you also need to type ‘-r’ for recursion, it will tell that the directory and all files and folder in that directory will be copied.
cp -r targetFolder/ PathToDestinationFolder/
mv command will move file/folder from current directory to destination directory.
If you have to remove a directory(folder) then you also need to type ‘-r’ for recursion, it will tell that the directory and all files and folder in that directory will be deleted.
rm -r targetFolder/
Sometimes you have to deal with permission of files and folders so that operations(read, write, execute) could be performed with appropriate permissions.
chmod permissionCode Folder/File
touch command is used to create a new file.
On linux, you can use vi editor to create and edit files.
This command is frequently used when you work with server. ssh makes connection of your remote device to with servers.
ssh -i privateKey.pem username@ipAddress
scp command is used when you have to copy something from remote device to server or server to remote device.
scp -i privateKey.pem fileName.txt username@public_DNS:~/. ;
This command will print all commands typed in past.
To clear all history type –
This command will help you in finding a particular data in a group of data. This is really useful command for devops.
I typed “ll | grep aws”
It will list only those files which contains word “aws”.