List all files with full details, the time, and in reverse order
df
List file systems
du
Disk usage
df/du -h
Make human-readable
wc -l
Word Count with -l meaning count lines
rpm -qa
-q means query
-a means all
List all packages installed
rpm -ihv /location/of/file/here
Install a rpm package
rpm -e packageName
Remove a package
rpm -qi
Information about the package
rpm -qc
List config files for that package
rpm -qf /binary/file/here
Get associated package name from binary
which commandNameHere
Get command’s binary file location
Bash Scripting
All scripts start with:
#!/bin/bash
echo outputs what is in front of it.
If statements are structured like so:
#!/bin/bashcount=100# -eq stands for Equalsif [ $count -eq 100 ]then echo Count is 100else echo Count is not 100fi
Or
#!/bin/bashclear# -e stands for if a file exists# -x if file exists AND is executableif [ -e /home/lucky/error.txt] then echo "File exist" else echo "File does not exist"fi
Loops are structured like so:
#!/bin/bashfor i in 1 2 3 4 5doecho "Welcome $i times"done
Or
#!/bin/bashfor i in dog jeff bobdoecho $idone
Or
#!/bin/bash# Numbers 1-5for i in {1..5}doecho Number $1done