[Linux] Linux Cheatsheet
Updated:
Linux Cheatsheet
7zip (7zr, 7za) command
(base) user@device:~$ sudo apt install p7zip p7zip-full
zip:
(base) user@device:~$ 7zr a ZIPPED_FILENAME.7z FILENAME
unzip:
(base) user@device:~$ 7zr x ZIPPED_FILENAME.7z
zip with password:
(base) user@device:~$ 7za a -pPASSWORD ZIPPED_FILENAME.7z FILENAME
unzip with password:
(base) user@device:~$ 7za x -pPASSWORD -y ZIPPED_FILENAME.7z
Find the physical memory available
(base) user@device:~$ grep MemTotal /proc/meminfo
Delete user
check user:
(base) user@device:~$ ls -la /home |grep USERNAME
delete only user:
(base) user@device:~$ sudo userdel USERNAME
delete user with home directory:
(base) user@device:~$ sudo userdel -rf USERNAME
-r
: delete all data including the home directory when deleting user
-f
: force option
Clear bash history
How to clear bash history completely?
(base) user@device:~$ cat /dev/null > ~/.bash_history
Other alternate way is to link ~/.bash_history
to /dev/null
avoiding memory copy:
(base) user@device:~$ cat /dev/null > ~/.bash_history && history -c && exit
Check Process
process list:
(base) user@device:~$ ps
# details
(base) user@device:~$ ps -f
# all
(base) user@device:~$ ps -e
(base) user@device:~$ ps -ef
Leave a comment