Basic Linux Commands Flashcards
List directory contents
ls - List files, directories, for long output do ls -l | more
Find text in a file
grep PATTERN [FILE]
Change current directory
cd - identical to windows, forward slashes instead of backwards /var/log
Shut down the system
shutdown, sudo shutdown 2 -r reboot cntrl c to cancel
Print Working Directory
pwd - displays the current working directory path
Change a user account password
passwd [username]
Move (rename) a file
mv SOURCE DEST
Copy a file
cp SOURCE DEST
Remove files or directories
rm - Does not remove directories by default, Directories must be empty or must be removed with -r
Make a directory
mkdir DIRECTORY
Change mode of a file system object
chmod - r,w,x, can also use octal notation, file owner u, group g, others o, all a
Change file owner and group
chown - sudo chown [OWNER:GROUP:] file
View or change wireless network configuration
iwconfig - requires knowledge of the wireless network - iwconfig eth0 essid studio-wireless
View or configure an interface and IP configuration
ifconfig eth0
View the current process
ps - Similar to the windows task manager -e all
Become a super user
su - you continue to be that user until you exit
Execute a command as the super user
sudo - only that command executes as the super user
Advanced Packaging Tool
apt-get handles the management of application packages > sudo apt-get install wireshark
Visual mode editor
vi - Full screen editing with copy paste and more, insert text with i
Covert and copy a file
dd - Backup and restore an entire partition > dd if= of= [Options]