{"id":196,"date":"2026-11-14T21:19:41","date_gmt":"2026-11-14T21:19:41","guid":{"rendered":"https:\/\/cyberstec.com\/?p=196"},"modified":"2026-11-14T21:20:12","modified_gmt":"2026-11-14T21:20:12","slug":"linux-terminal-command-arch-and-debian","status":"publish","type":"post","link":"https:\/\/cyberstec.com\/index.php\/2026\/11\/14\/linux-terminal-command-arch-and-debian\/","title":{"rendered":"Linux terminal command (Arch and Debian)"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">~ : home directory<br># : Root<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">$ : User<br>&amp; : run commands in the background of your terminal<br>&amp;&amp; : combine multiple commands together<br>> : re-director, take the output from a command (such as using cat to output a file) and direct it elsewhere<br>>>: similar to > but instead of replacing the output, it will add it to the one already present<br>&#8211;help or -h : put after the command name will show the help menu<br>adduser username : to add a user<br>alias : shows the shell&#8217;s aliases<br>apt search packagename : search all the package with that name on it<br>apt update : Debian update the system by downloading new packages<br>apt upgrade : Debian install the downloaded packages<br>apt install : Debian install a program\/application<br>apt remove : Debian remove program\/application<br>apt autoremove : Debian remove program\/application orphan dependencies<br>bc : basic calculator<br>cat : shows every line inside the file from the terminal<br>cd : change directory (&#8220;cd download&#8221; if you want to go to the download directory)<br>cd &#8211;\u00a0or\u00a0cd .. : to go back to the previous directory<br>chage -E date user : set expiration date for the user<br>chage -l user : shows the expiration date of the user ( type -1 for never )<br>chage -M days user : to set the number of days the user had to change password<br>chmod : change file permission (Example: 764 = rwxrw-r&#8211;)<br>[d|rwx|rwx|rwx = dir\/file|user|group|other]\u00a0 [4+2+1 = rwx = read write execute]<br>chmod +x\u00a0filename : add execute to all<br>chmod -x filename : remove execute to all<br>chmod u+x filename : add execute to user only<br>chsh -l : to check the path of the shell<br>chsh -s \/path\/of\/the\/shell : to set the new shell for the user<br>clear or &#8220;Ctrl&#8221; + &#8220;l&#8221; : clear the terminal<br>&#8220;Ctrl&#8221; + &#8220;+&#8221; : zoom in<br>&#8220;Ctrl&#8221; + &#8220;-&#8221; : zoom out<br>cp\u00a0filename directory : copy and paste the file in the directory<br>date : shows the date<br>df -h : shows availible and used disk\/partiton space<br>diff filename1.txt filename2.txt : to check if there is difference inside the files<br>echo : displays what you type<br>EDITOR=nano visudo :from root to edit with nano \/etc\/sudoers privileges (if member of the wheel: remove #)<br>fdisk : to start modifying the disk partitions (umount device first)<br>fdisk -l : shows disk and partitions<br>free : shows memory and swap usage in byte<br>free -m : shows memory and swap usage in Mb<br>grep\u00a0word filename : shows the specific word in a specific file<br>grep\u00a0word * : shows the specific word in every file in that directory<br>grep -c word filename : count how many time the word is in that file<br>grep -i word filename : same as grep alone but with no case sensitivity<br>grep -n word filename : same as grep but shows also the line number<br>grep -r word \/path\/ : shows the word inside every file and evry folder from that path\u00a0<br>grep -v word filename : shows every line apart for the one containing that word<br>grep -name filename : to look for a specific file<br>groups user : to check all the groups that the specific user is in<br>help : help page documentation of the program selected<br>head : print out first 10 line on the selected file<br>history : it will show the command history<br>htop : system monitor<br>id : user identity<br>ip : shows\/manipulate routing, net devices and so on<br>ip address : shows your IP address<br>kill : close the program<br>less : similar to cat, mainly used for longer files<br>locate : locate the file or directory<br>ls : list file and directory<br>ls \/ : list files in the fist directory<br>ls -a : list all file and directory (even the hidden one)<br>ls -all or ll -a : list all file and directory + other information<br>ls -lah : list all file and directory + other information in human readable number 4k instead 4000<br>lsblk : list all disks and partitions<br>lsplug : list all usb devices<br>lspci : list pci devices<br>man : manual, it&#8217;s basically the manual for another program, you can even type &#8220;man man&#8221;<br>makepkg -s : run the command inside the directory of the tar -xvf extracted file to create an installation file<br>mkdir : create a directory (folder)<br>mkfs.typefile \/dev\/devname: to format the disk with the type file (ext4\/exfat). create 1st partitions with fdisk<br>mkfs.ext4 -n &#8220;label&#8221; \/dev\/devname : to label the device or partition<br>mount : shows all the volumes on every disk<br>mount | grep diskname : filter only the volumes on the specified disk<br>mv filename directory : move file to directory<br>mv filename1 filename2 : to rename file<br>mv *.txt directory : to move all file with that extension<br>ncdu : shows how much space is used and by which folder inside the directory<br>ncdu \/ : shows for the all system<br>ncdu \/ -x : same as above but only for the local system, excludes the external drives<br>net : tool to administrate samba and CIFS servers<br>nmap -sV ipaddress : shows port and version<br>nmap -v : check the nmap version<br>nmap ipaddress.0\/24 : scan entire subnet (nmap -sP ipsubnet shows a simplified view)<br>nmap ipaddress or hostname : to scan all the ports on that system<br>nmap -T5 ipaddress : to scan at maximum speed<br>[ From T1 (slower but less detectable) to T5 (faster and less accurate), default is set to T3]<br>pacman -Qdt : queering package database for orphans, so they can be removed<br>pacman -R: Arch program remove<br>pacman -S: Arch program install<br>pacman -Ss keyword : Arch program search for packages using keyword<br>pacman -Syu : Arch to update\/upgrade<br>pacman -Syy : Arch refresh package databese<br>pacman -U filename : use it inside the directory where the file to install the selected file after makepg -s<br>passwd -l user : lock the user sccount<br>passwd -u user : unlock the user sccount<br>ping ipaddress: test and send packages to the specify web address<br>ps : process status<br>pwd : print working directory (shows you where you are)<br>reboot : reboot the system<br>rmdir : remove directory<br>rm\u00a0filename : remove file<br>rm -rf directory or filename : forcefully remove directory and all it&#8217;s files<br>samba : server that provides services to clieants<br>sar -b : to check why system is slowing down<br>sar -r : to check current memory<br>sar -S : to check current swap<br>sar -u : to check current cpu usage<br>sar -u -f \/etc\/var\/log\/sysstat\/filename : to check the specific log that was saved<br>ss : investigate sockets<br>ssh username@ipaddress : to log in using ssh<br>su : to switch to root<br>su username : to switch to the username<br>sudo : obtain administrator privileges<br>sudo !! : to run the last command if you forgot to put sudo on the front<br>tail : print out last 10 line of the select file<br>tar -xvf filename : extract the wget downloaded compressed file<br>time commandname : shows how much time the command took<br>top : shows all the running program<br>touch filename.txt : to create a text file (or you can create one with the text editor: nano filename)<br>umount \/dev\/devname : unmount the device or partition but still able to see it<br>unalias aliasname : remove the alias<br>uname : info on device<br>usermod -aG group user : add the specific user to the specific group ( type &#8221; , &#8221; without spaces to add more groups )<br>usermod -d \/testhome\/testdir\/ &#8211;move-home username : to move the user&#8217;s home directory to a new one with all it&#8217;s files<br>usermod -e date user : to set an expiration date for the user<br>usermod -l newname oldname : to change user&#8217;s name<br>usermod -L user : to lock that specific user<br>usermod -U user : to unlock that specific user<br>visudo : to edit configuration file, temporary saves it and checks the syntax for error<br>wget : non interactive network downloader &#8220;wget URL&#8221;<br>whereis : path the command select + man page<br>which\u00a0command : path to the command select &#8220;which ls&#8221;<br>who : who is logged in<br>whoami : to check the name user<br>yay : same as pacman but for AUR (automated)<br>yay -Syu : update\/upgrade standard and AUR<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>~ : home directory# : Root $ : User&amp; : run commands in the background of your terminal&amp;&amp; : combine multiple commands together> : re-director, take the output from a&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-196","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/cyberstec.com\/index.php\/wp-json\/wp\/v2\/posts\/196","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cyberstec.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cyberstec.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cyberstec.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/cyberstec.com\/index.php\/wp-json\/wp\/v2\/comments?post=196"}],"version-history":[{"count":2,"href":"https:\/\/cyberstec.com\/index.php\/wp-json\/wp\/v2\/posts\/196\/revisions"}],"predecessor-version":[{"id":198,"href":"https:\/\/cyberstec.com\/index.php\/wp-json\/wp\/v2\/posts\/196\/revisions\/198"}],"wp:attachment":[{"href":"https:\/\/cyberstec.com\/index.php\/wp-json\/wp\/v2\/media?parent=196"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cyberstec.com\/index.php\/wp-json\/wp\/v2\/categories?post=196"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cyberstec.com\/index.php\/wp-json\/wp\/v2\/tags?post=196"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}