13 Linux Commands Every Engineer Should Know
uname operative system
sh
uname
#Linuxpwd current directory
sh
pwd
#/home/userNamecd change directory
sh
cd /etc
#username@server: /etc$ls list directory
flags:
sh
-l list directory with all information
#drwxr-xr-x 2 root root 4096 Apr 26 00:00 backups
#drwxr-xr-x 23 root root 4096 Apr 22 07:55 cachecat visualize content file
sh
cat file.name
#Lorem ipsum dolor sit amet, esse cupidatat ipsum ea.
#Adipisicing officia dolore aliquip incididunt ea adipisicing officia laboris incididunt veniam consectetur.| "Pipe" command is used to pass the output of one command as input to another
grep filter, stands for Global Regular Expression Print
sh
cat file.name | grep textInSide
cat file.name | grep textInSide > resultSaveInFileNamewc word count command
sh
flags:
-l count lines
-w count words
-c count bytes
-m count characters
-L find longest line lengthcp copy file to
sh
cp file.name file.name.copyfind used to search for files and directories in directory hierarchy
sh
. current directory
/ root file system
ex: find / -name "*.conf"
ex: find / -name "*.conf" | grep db that have db in itdiff difference between two files
sh
ex: diff file.name file.name.bkcurl stands for Client URL
sh
"used to transfer data from or to a server
using various protocols like HTTP, FTP
commonly used for interacting with APISs
and debugging networking requests"
ex: curl https://google.comchmod change permissions on file access
root change to root
sh
sudo su -
sudo -i
#root@serverName:~#