Command Deck Flashcards
Review command function
ll
list directories/files with permissions details
Similar to ls-l
rm
removes a file/deletes a file
rm -r
removes/deletes a directory or file
Go back to the root directory (“/root” NOT “/”)
cd ~
Make a copy of dir4 to be copied into dir5
cp -r dir4 dir5
Change the name of file good_burger to bad_burger
mv good_burger bad_burger
Move file3 into dir1
mv file3 dir1/
The files and folders have to be in the same directory level to move files into folders
Display the contents of file5 with numbered lines
cat -n file5
Find file study.log in the system
find / -name study.log
Login to the following server remotely using vsc:
Server Name: 198.58.119.40
Username: u5bt
Password: abc
Command:
ssh u5bt@198.58.119.40
Prompt:
user u5bt
enter password: enter abc
Login to a LightSail Centos 7 server remotely with the public ip_address 184.24.68.30 using key access. The key is deVops
- cd into Downloads folder to access the key
- type: ssh -i deVops.pem centos@184.24.68.30
Display the following message in the command line:
Thank you God for this opportunity. I pray for future success.
echo Thank you God for this opportunity. I pray for future success.
whoami
Gives your user id
id -r user2
Print real user ID for user2
id -G user3
Print effective group ID for user3
iostat
Check cpu, os, kernel name and version, hard drive info, server size, cpu percentage, date, ip address
Run an inventory on the server
- Check # hard drives - iostat or lsblk
- Check # of cpus (and data) - iostat or nproc (lscpu)
- Check cpu percentage - iostat
- Check kernel type and name - uname + uname -r
- Check OS type - cat /etc/*release
- Check memory - top or free
lscpu
access system inventory
* brand, model, model name, speed and so on
List commands required to obtain cpu information
- lscpu
- nproc
- iostat
- top
List commands required to obtain hard drive information
- lsblk
- iostat
Obtain OS name, version and associated information on a Ubuntu server
lsb_release -a
Obtain OS name, version and associate information on a Centos server
- cat /etc/os-release
OR - cat /etc/*release
Obtain kernel name
uname or uname -s
Command for kernel release (version)
uname -r