Você está na página 1de 1

Pi My Life Up - Linux Cheat Sheet

General Commands Networking


Man ls Brings up the manual page for ls ping host Pings a host
ls | head Pipes | allows you to direct output hostname Hostname of the system
from one command into another ifconfig Shows network configuration
date Shows system date details for the interfaces on
whoami Shows your username current system
uptime Shows uptime ssh Connect to another computer
uname -a Show system & kernel using SSH
File System scp Transfer files over SSH
ls Directory Listing wget {URL} Downloads a file directly to
tree Indented file/directory listing the device
cd Change directory netstat -tupl Active connections to/from
pwd Display current directory device
mkdir newDir Creates a directory
rmdir oldDir Removes a directory Process Management
cp file newfilename Copies a file to a new location ps Show snapshot of current processes

mv file.txt ./newDir Moves a file to a new location top Show real time processes
touch file Sets the last modified timestamp kill pid Kill process with id pid
cat List contents of a file pkill name Kill process with name
head file Outputs first 10 lines of a file killall name Kill processes with name
tail file Outputs last 10 lines of a file
Users Management
chmod 777 file CHMOD is used to alter the
id Get the id of a user or group
permissions of a file or files.
who List users that are logged in
chmod u=rw file You can use symbols or num-
last List of users recently logged in
bers depending on what you
groupadd name Adds a new group
prefer.
useradd name Adds a new user
chown pi:root file CHOWN will change the user
userdel name Deletes a user & all files
and/or the group that owns a
related to that user
file.
deluser name Deletes user with options to
unzip archive.zip Unzip will extract the files and
remove certain data
directories from a compressed
usermod Modify a user account
zip archive.
passwd Change your password or a
tar -cvzf Compress and extract the
password of another account
tar -xvzf contents of an archive in the
tar format. Shortcuts
-c to compress & -x to extract !! Repeats last command
ctrl+z Stops command, resume using fg for
Searching foreground or bg for background
grep “search” *.txt Search for a pattern inside files ctrl+c Halts the current command
find . -name ‘help’ Will search for directories & ctrl+w Deletes 1 word on the current line
files that match a pattern ctrl+u Deletes entire line
whereis ls Displays documentation, ctrl+r Search previous commands
binaries & source files of a exit log out of current session
command

Last Updated: 09/01/2017


For suggestions, fixes & more please visit pimylifeup.com

For more information visit: pimylifeup.com

Você também pode gostar