KEMBAR78
M Ashraf - Linux Basics | PDF | Computer File | Superuser
0% found this document useful (0 votes)
69 views2 pages

M Ashraf - Linux Basics

This document provides a cheat sheet summarizing common Linux commands and files system structure in 3 pages. It outlines key directories like /bin, /boot, /etc, and their purposes. It also describes commands for managing users and groups, navigating directories, finding files, and editing text files. Finally, it summarizes the apt package manager and common operations on files and directories like copying, moving, renaming, and deleting files.
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)
69 views2 pages

M Ashraf - Linux Basics

This document provides a cheat sheet summarizing common Linux commands and files system structure in 3 pages. It outlines key directories like /bin, /boot, /etc, and their purposes. It also describes commands for managing users and groups, navigating directories, finding files, and editing text files. Finally, it summarizes the apt package manager and common operations on files and directories like copying, moving, renaming, and deleting files.
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 Basics Cheat Sheet

by m_ashraf via cheatography.com/84329/cs/19923/

Linux files ystem user accounts operations other (cont)

/ root directory of the entire file sudo <co​‐ do a command as a super badblocks searches for bad sectors in
system hirarchy mma​nd> user (root) /dev/sda1 -v sda1 and put the output in
/bin/ Essential user command binaries passwd change the user password > file file

/boot/ static files of the boot loader whoami show the current user the > here is a part of the command

/dev/ device files who show user detaled data


Navigating direct​ories
/etc/ host-s​pecific system config​uration su <us​ern​‐ switch user
ame> cd <di​rec​tor​‐ change direct​ory:go to the
/home/ user home direct​ories
y> given directory
/lib/ essential shared libraries and sudo make new user
adduser cd ~ change directory to home
kernel modules
<us​ern​ame> cd .. go up one directory
/media/ mount point for removable media
such as USB sudo add existing user to a group cd - go to the previous working
adduser directory
/mnt/ mount point for a tempor​arily
<us​ern​ame> ls list directory contents
mounted filesy​stems
<gr​oup​nam​‐
/opt/ optional commercial software ls -l use long listing format
e>>
/sbin/ system binaries ls -lh use human readable long
sudo add the user to the sudoers
listing format
/usr/ user utilities and applic​ations adduser file (giving him the root
find <file or searchs for file or directory
/usr/s​‐ shared files over the system <us​ern​ame> privilage)
direct​ory> in the working directory
hare/ sudo
locate <file searchs for file or directory
/root/ home directory for the root user sudo deluser delete user account
or direct​ory> in the whole system
<us​ern​ame> (doesn't remove his files in
these are not all the filesystem direct​ories
the home directory remove pwd print working directory
,but they're the most important to know
it yourself) the '<' and '>' are not used in the command
they're just for making things here obvious
other

uname -a displays detaled system


inform​ation
free display memory size
(total​,used and free sizes)

free -h display memory size in


human readable format
lsblk list block devices
badblocks searches for bad sectors in
<de​vic​e> -v device

By m_ashraf Published 24th June, 2019. Sponsored by CrosswordCheats.com


cheatography.com/m-ashraf/ Last updated 24th June, 2019. Learn to solve cryptic crosswords!
Page 1 of 2. http://crosswordcheats.com
Linux Basics Cheat Sheet
by m_ashraf via cheatography.com/84329/cs/19923/

terminal tips operations on files and direct​ories apt package manager

using up navigating throw your cp <fi​le> <target copy file to a target apt search search for package in the
and down command history dir> directory <pa​ckage database
arrows mv <fi​le> move file to a target name>
ctrl+R searching for previously typed <target dir> direct​ory,and can be apt show show detaled inform​ation
command in your history used to rename files <pa​ckage about the package
clear clears terminal rm <fi​le> remove file name>

history view command history rm -r <di​r> remove directory recurs​‐ sudo apt install package, if it's already
ively install <pa​‐ installed it will search for
<co​mma​‐ for long output commands:
ckage updates for it,if it's already
nd> | less view only one page and give rm -i prompt for every
name> the last version it tell you that
you the ability to navigate removal
through output lines using sudo apt remove installed package
rm -v explain what's being
arrow keys exit using Q remove
done
<pa​ckage
<co​mma​‐ for long output commands: nano <fi​le> a terminal based text
name>
nd> | view only one page and give editor
more you the ability to navigate apt list -- list installed packages
chmod <mo​de> changes mode (permi​‐
through output pages using inst​alled
<fi​le> ssions) of the file
Enter exit using Q sudo apt remove the packages that
chmod -R <mo​‐ change mode of
<co​mma​‐ perform two commands one autoremove has no use
de> <di​r> directory and its
nd> && after the other sudo apt update packages database
contents recurs​ively
<co​mma​‐ update
chown <ow​ner> change owner of the file
nd> sudo apt upgrade installed software
file
man show manual of that program upgrade
chown <ow​ner> change owner and
<comman or tool
apt is just a front-end for apt-get so it won't
: <gr​oup> file group of file
or progra​‐
be different if you use any of them but for
m> mkdir <dir makes new directory
some user interface inhancing
name>
zip <ar​chive make a .zip archive
name> <files to including the selected
be archiv​ed>> files
unzip <ar​chi​ve> extract the archive in the
working directory

By m_ashraf Published 24th June, 2019. Sponsored by CrosswordCheats.com


cheatography.com/m-ashraf/ Last updated 24th June, 2019. Learn to solve cryptic crosswords!
Page 2 of 2. http://crosswordcheats.com

You might also like