0% found this document useful (0 votes)
23 views2 pages

Idan SHM - Linux Cheat Sheet Centos Fedora Based

This document is a cheat sheet for Linux commands specifically for CentOS and Fedora systems. It covers various categories including built-in manuals, system info, file manipulation, user management, disk utilities, package management, and networking commands. Each section provides concise command syntax and descriptions for quick reference.

Uploaded by

jean
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views2 pages

Idan SHM - Linux Cheat Sheet Centos Fedora Based

This document is a cheat sheet for Linux commands specifically for CentOS and Fedora systems. It covers various categories including built-in manuals, system info, file manipulation, user management, disk utilities, package management, and networking commands. Each section provides concise command syntax and descriptions for quick reference.

Uploaded by

jean
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Linux Cheat Sheet <CentOS/Fedora based> Cheat Sheet

by idan_shm via cheatography.com/39583/cs/12287/

Built-in manuals and info Navigation

man <Command> Show manual for the command cd <Path> Change directory

info <Command> Show wide info about the command (Can be pwd Present/print working directory
secondary to man)
ls List directory contents
<Command> --help Short comman​d/tool usage
ls -la Long list directory contents
and hidden files and wide info
System info
find /home/user -name '*.txt' Search and print
uname -a Show system and kernel version all the .txt files
under the user directory
history Show current user bash commands history
mount show or mount filesy​stems
date Show current date and time
umount unmount file systems
cal Show calendar

uptime Show system uptime


File manipu​lation
df -h Show all mounted file systems
touch Update the file last modifi​cation date, if the file
du -h <Path> Show disk usage, to get better unders​tanding what
does not exist, touch will create a new file
is taking all the disk space
cp Copy files
free -h Show available memory and usage
mv Move files, also used to rename a file
which <Command> Show the binary​/script location if it is under the
rm Delete files or direct​ories ( can be used with -r
$PATH
for recursive)
top Show running processes on realtime
mkdir Create new directory
ps -aux Capture all running processes and print in terminal
rmdir Delete directory (Only if empty)
dmesg Print or control the kernel ring buffer
chmod Change file mode/p​erm​issions r=4 w=2 x=1
cat /var/log/syslog Show system logs
chown <owner:group> Change file ownership
journalctl Query the systemd journal
cat Print file content

Bash Variables head Show first 10 lines of a file

tail Show last 10 lines of a file


env Show enviro​​nment variables
tail -F Output last lines of the file as it changes
echo $HOME Home directory
file Show info about the file such as file type
echo $PATH Executable search path

echo $SHELL Current shell


Users and groups management

whoami Show current user

sudo adduser <Username> Create a new user

sudo userdel -rf <Username> Delete user ( Including the home directory
)

sudo passwd <Username> Change user password

id Show user uid, groups and info

who Show current logged in users

By idan_shm Not published yet. Sponsored by ApolloPad.com


cheatography.com/idan-shm/ Last updated 17th July, 2017. Everyone has a novel in them. Finish Yours!
Page 1 of 2. https://apollopad.com
Linux Cheat Sheet <CentOS/Fedora based> Cheat Sheet
by idan_shm via cheatography.com/39583/cs/12287/

Users and groups management (cont) VIM Editor

sudo usermod -aG <Group> <User> Add user to group Delete character

sudo groupdel <Group> Delete group


VIM Editor
cat /etc/group List all groups

cat /etc/passwd List all users :x + enter Save and quit

:q! + enter exit, discard changes


Disk utils x Delete character

i Insert text

a append text
IO Redire​​ction
dw Delete word
cmd < file Input to cmd from file
d$ Delete to the end of the line
cmd1 <(cmd2) Output of cmd2 as file input to cmd1
0 (Zero) Move to the start of the line
cmd > file stdout of cmd to file
2w Jump 2 words
cmd > /dev/null Discard stdout of cmd
d2w Delete 2 words
cmd >> file Append stdout to file
dd Delete a whole line
cmd 2> file stderr of cmd to file
2dd Delete 2 whole lines
cmd 1>&2 stdout to same place as stderr
u Undo previous actions
cmd 2>&1 stderr to same place as stdout
U Undo all the changes on a line
cmd &> file Every output of cmd to file
CTRL-R Undo the undo's
cmd = Command
r Replace character
stdout = Standard output
stderr = Error output

Package management

dnf upgrade Upgrade a package or packages on your system

dnf search <Package> Search package details for the given string

dnf remove <Package> Remove a package or packages from your


system

dnf repolist Display the configured software reposi​tories

rpm -i <Package> Install rpm package

rpm -e <Package> Uninstall rpm package

Networking

ifconfig -a Show all network interfaces and more

netstat Print network connec​tions, routing tables, interface statis​tics,


masquerade connec​tions, and multi-cast member​ships

By idan_shm Not published yet. Sponsored by ApolloPad.com


cheatography.com/idan-shm/ Last updated 17th July, 2017. Everyone has a novel in them. Finish Yours!
Page 2 of 2. https://apollopad.com

You might also like