Bootstrap FreeKB Articles

Linux Commands articles


Commands $? (exit code or return code) 7z Add a label to a partition using the e2label command Add swap space to a Linux partition alias (create commands) apt-cache (search for a package) apt-get (install update packages) arp (address resolution protocol) at (schedule a one time job) base64 command basename batch (schedule jobs) blkid command (determine file system type) bunzip2 (unzip a bzip2 archive) bzip2 (compress file) Capture packets using the tcpdump command cat or tac (view the content of a file) chage (user account aging information expire password) Check a file system for errors in Linux chkconfig (runlevel) chmod (change a file or directory standard permissions) chown (change ownership) Common vi editor commands cp (copy) cpio (create, view, and extract an archive) Create a disk partition using the fdisk command Create file using the touch command Create hard, soft and symbolic links (symlink) using the ln command cut date command debugfs command (recover a deleted file) declare command Delete a disk partition using the fdisk command Delete files and directories using the rm (remove) command df command (disk filesystem usage) df command (inodes) dhclient (dhcp - obtain, renew, and release IP address) diff command (differences between files) dig (name server lookup DNS) dig (view DNS information) Display CPU details using the lscpu command Display file atime ctime mtime using the stat command Display how long server has been running using the uptime command Display IP address info using the ip command Display when system was last rebooted using the who command echo (print output) edquota (edit quota) eval exec (execute a command) expand (replace tabs with spaces) file command (determine file system type) file command (determine file type) Filter output using awk Filter output using grep find command - date accessed (-atime) find command - date changed (-ctime) find command - date modified (-mtime) find command - exclude "permission denied" find command - exclude directories from search (-not -path) find command - Exclude file systems from search (-xdev) find command - executable files find command - hidden files and directories find command - mindepth and maxdepth find files owned by group find files owned by user Find files that are greater than or less than a certain size find files that match permission Find files using the locate command fold (wrap text) free (view RAM memory) fuser (determine the PID of a file) fuser (view kill processes) gdisk (format disk partition) genkey (create a public / private key pair using crypto-utils) getfacl (view access control entries) gpasswd (change group password) grep (--exclude-dir) groupadd (create group) groupmod (modify group) growisofs (burn CD or DVD) gunzip (unzip a gzip archive) gzip (compress file) hash command history hostname How to use the DD and mkisofs commands to create an ISO or IMG file in Linux htpasswd (add user) htpasswd (delete user) hwclock (hardware clock) iconv (character encoding standard) id command ifconfig (IP address information) ifconfig command (temporarily change the MAC address) ifconfig promisc (promiscuous mode) Increase the size of a disk partition using the fdisk command info (information about a command) insmod (insert a module) ip neighborhood (view address resolution cache) ipcrc (remove semaphores) ipcs (list semaphores) isql (connect to a database) isql --version (SQL version) join (combine or merge lines in two different files) journalctl (view the journal) journalctl (word wrap text) journalctl --since and --until filters kill (end a process) killall (end a process) last (view current and recently logged in users) Linux LANG variable with examples List CPU stats using the sar command List environment variables using the env command List environment variables using the printenv command List files and directories using the find command List files and directories using the ls command List LDAP and local user accounts using the getent passwd command List partitions using the fdisk command List shared libraries modules using the ldd command List the amount of memory and CPU used using the top command List the amount of space being using the du (disk usage) command locale (language, country, character encoding standard) logger (add records to a log file) lp (print a file) lpc (list printers) lpq (print queue) lpr (print a file) lprm (remove print jobs) lpstat (list available printers) ls (list) --ignore lsblk command (list hard drive solid state drive) lsmod (list loaded modules) lsof command man (view manual for a command) md5sum mdadm --detail (show details of RAID array) mdadm --examine (partition RAID) mdadm --stop (stop a RAID array) mkdir (make directory) mke2fs (create a file system) mkfs (create a file system) Modify Network Manager using the nmlci command modinfo (view module information) modprobe (insert and remove modules) Mount a partition or share using the mount command mv (move) netstat (view network connections) nice (influence a process to run with higher or lower priority) nl (number lines) nohup command (run a process while logged out) nslookup (name server lookup DNS) ntpdate (synchronize to an NTP server) ntpq (view NTP servers being used) parted (format disk partition) passwd (change a users password) paste (read, delimit, combine files) pdbedit command (Samba users) pr (format file for printing) printf (print output) Prompt for user input using the read command ps commad - show processes being run by a certain user (-U) ps command (process PID) ps command - add additional columns (-f) ps command - display a process associated with a certain PID (-p) ps command - display how long a process has been running (-o etime etimes) ps command - show all running processes (-e -A ax) ps command - show processes being run by a system service (-C) quotacheck command (check disk quota) quotaon (enable quota) regex using awk and gsub releasever Remove a module using the rmmod command Remove directory using rmdir renice (influence a process to run with higher or lower priority) repoquery repquota command (view quota) resolvectl command (DNS) restorecon route (view and create network routes) rpm2cpio command (compress an RPM package into a CPIO archive) rsync (remote copy) schedule reoccurring jobs using crontab (cron table) scp (transfer files using secure copy protocol) sed (delete) sed (replace string) Send and retrieve email using the mail command Send and retrieve email using the sendmail command seq (sequence of numbers) service command Set file atime ctime mtime using the touch command setfacl (create update access control entries) Setting Alternatives Setting time zone using the TZ variable sha256sum shutdown (shutdown, reboot, halt, poweroff) sort source (export variable) split (divide a single file into multiple files) ssh-copy-id ssh-keyscan command (get SSH keys) star (create, view, extract an archive) su (switch user) sudo sudo (give a group permission to run certain commands) sudo (give a user permission to run certain commands) systemctl command tee (redirect output to both the console and a file) test timedatectl tr (trade, replace, change characters) tracepath (trace route to a host) traceroute tzselect (time zone select) ulimit (list and update a users limits) umask (view and update default permission masks) umount (unmount a partition or share) uname (display information about the kernel) unexpand (replace spaces with tabs in a file) unfold (unwrap text) uniq (filter unique lines) unlink unset (undefine a variable) unzip useradd (create a user account) userdel (delete user account) usermod (modifying a users account) Using DPKG to manage Debian packages in Linux Validate an XML and XSD file using the xmllint command View logged in users using the who command Viewing boot events using dmesg or the boot.log w (view logged in users) wall (send message to other systems) watch command (run a command once every x seconds) wc (count words, characters, and lines) wget (download files from remote systems) whereis command which command xargs (convert stdin to an argument) xml_grep (parse XML file) xwininfo command (display information about a window) yum (download, install, remove, update packages) yumdownloader (download a package) zip Fuse How to access an SD Card on a Samsung device using Linux Linux Commands hostnamectl Return directory name using dirname None Understanding the X font server in Linux notepad Install notepadqq Troubeshooting Resolve "Sorry, user is not allowed to execute as root" Troubleshooting Resolve "End of central directory signature not found" Resolve "failure: repodata/repomd.xml [Errno 256] No more mirrors to try." Resolve "Mount Error(5) Input/Output error" Resolve "mount: bad option; for several filesystems (e.g. nfs, cifs) you might need a /sbin/mount.<type> helper program." Resolve "not allowed to run sudo" Resolve "Read Only File System" Resolve "sudo: unable to initialize policy plugin" Resolve "The semaphore timeout period has expired" Resolve "too many open files" Resolve "ulimit: open files: cannot modify limit: Operation not permitted" Resolve error "Mount Error(13) Permission Denied"