diff --git a/LICENSE b/LICENSE deleted file mode 100644 index d13cc4b..0000000 --- a/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -The MIT License (MIT) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/README.md b/README.md deleted file mode 100644 index cdac94d..0000000 --- a/README.md +++ /dev/null @@ -1,4443 +0,0 @@ -

- - - - -# Ultimate List of Linux bash commands - -_Bash is the [Unix](https://www.google.com/search?q=What+is+UNIX+explain%3F&client=firefox-b-d&sxsrf=ALiCzsZmYtgn9ctD5vHAqgVFkM5tZ514pw%3A1667926333803&ei=PYlqY6XIMNmNwbkPqeK3qAo&ved=0ahUKEwjl2ozlhZ_7AhXZRjABHSnxDaUQ4dUDCA4&uact=5&oq=What+is+UNIX+explain%3F&gs_lcp=Cgxnd3Mtd2l6LXNlcnAQAzIFCAAQgAQyBQgAEIAEMgUIABCABDIGCAAQFhAeMgYIABAWEB4yBggAEBYQHjIFCAAQhgMyBQgAEIYDMgUIABCGAzIFCAAQhgM6CggAEEcQ1gQQsAM6BwgAELADEENKBAhNGAFKBAhBGABKBAhGGABQnAFYnAFgvwNoAXABeACAAa0BiAGtAZIBAzAuMZgBAKABAqABAcgBCsABAQ&sclient=gws-wiz-serp) command-line interface (CLI). Also called the terminal, the command line, or the shell. It's a command language that allows us to work with files on our computers in a way that's far more efficient and powerful than using a GUI (graphical user interface)._ - -

A to Z command list Books -

- -> **Note** 💡
-> Use `Ctrl+f` to search keywords in desktop browsers, for mobile go to `menu > find in page`. - -

- -

Table

- -#### │ [A](#-a) │ [B](#-b) │ [C](#-c) │ [D](#-d) │ [E](#-e) │ [F](#-f) │ [G](#-g) │ [H](#-h) │ [I](#-i) │ [J](#-j) │ [K](#-k) │ [L](#-l) │ [M](#-m) │ [N](#-n) │ [O](#-o) │ [P](#-p) │ [Q](#-q) │ [R](#-r) │ [S](#-s) │ [T](#-t) │ [U](#-u) │ [V](#-v) │ [W](#-w) │ [X](#-x) │ [Y](#-y) │ [Z](#-z) │ - -
- -

A

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CommandDescription
acceptAccept or Reject jobs to a destination, such as a printer.
accessCheck a user’s RWX(read, write and execute) permission for a file.
accton Used to turn on or turn off the process for accounting or change info process accounting file.
aclocalUsed to automatically generate aclocal.m4 files from configure.in file.
aconnectALSA(Advanced Linux Sound Architecture) sequencer connection manager.
acpiShow information about the Advanced Configuration and Power Interface.
acpi_availableCheck if ACPI(Advanced Configuration and Power Interface) functionality exists on the system.
acpidInforms user-space programs about ACPI events.
addr2lineUsed to convert addresses into file names and line numbers.
addressesFormats for internet mail addresses.
agettyAn alternative Linux Getty that manages physical or virtual terminals to allow multi-user access
aliasCreate an alias, a shortcut that references a command.
alsactlAccess advanced controls for ALSA soundcard driver.
amidiPerform read/write operation for ALSA RawMIDI ports.
amixerAccess CLI-based mixer for ALSA soundcard driver.
anacronUsed to run commands periodically.
aplaySound recorder and player for CLI.
aplaymidiCLI utility used to play MIDI files.
apmShow Advanced Power Management (APM) hardware info on older systems.
apmdUsed to handle events reported by APM BIOS drivers.
aproposShows the list of all man pages containing a specific keyword.
aptAdvanced Package Tool, a package management system for Debian and derivatives.
apt-getCommand-line utility to install/remove/update packages based on APT system.
aptitudeAnother utility to add/remove/upgrade packages based on the APT system.
arA utility to create/modify/extract from archives.
archDisplay print machine hardware name.
arecordJust like aplay, it’s a sound recorder and player for ALSA soundcard driver.
arecordmidiRecord standard MIDI files.
arpUsed to make changes to the system’s ARP cache.
asA portable GNU assembler.
aspellAn interactive spell checker utility.
atUsed to schedule command execution at specified date & time, reading commands from an input file.
atdUsed to execute jobs queued by the at command.
atqList a user’s pending jobs for the at command.
atrmDelete jobs queued by the at command.
audiosendUsed to send an audio recording as an email.
aumixAn audio mixer utility.
autoconfGenerate configuration scripts from a TEMPLATE-FILE and send the output to standard output.
autoheaderCreate a template header for configure.
automakeCreates GNU standards-compliant Makefiles from template files.
autoreconfUpdate generated configuration files.
autoscanGenerate a preliminary configure.in file.
autoupdateUpdate a configure.in file to newer autoconf.
awkA scripting language used for manipulating data and generating reports. Also used to find and replace text in a file(s).
- -[⬆ ʀᴇᴛᴜʀɴ ᴛᴏ ᴛᴏᴩ](#table) -

B

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CommandDescription
badblocksSearch a disk partition for bad sectors.
bannerUsed to print characters as a poster.
basenameUsed to display filenames with directory or suffix.
bashGNU Bourne-Again Shell.
batchUsed to run commands entered on a standard input.
bcAccess the GNU bc calculator utility.
bgSend processes to the background.
biffNotify about incoming mail and sender’s name on a system running comsat server.
bindUsed to attach a name to a socket.
bisonA GNU parser generator, compatible with yacc.
breakUsed to exit from a loop (eg: for, while, select).
builtinUsed to run shell builtin commands, make custom functions for commands extending their functionality.
bzcmpUsed to call the cmp program forbzip2 compressed files.
bzdiffUsed to call the diff program for bzip2 compressed files.
bzgrepUsed to call grep for bzip2 compressed files.
bzip2A block-sorting file compressor used to shrink given files.
bzlessUsed to apply ‘less’ (show info one page at a time) to bzip2 compressed files.
bzmoreUsed to apply ‘more’ (an inferior version of less) to bzip2 compressed files.
- -[⬆ ʀᴇᴛᴜʀɴ ᴛᴏ ᴛᴏᴩ](#table) -

C

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CommandDescription
calShow calendar.
cardctlUsed to control PCMCIA sockets and select configuration schemes.
cardmgrKeeps an eye on the added/removes sockets for PCMCIA devices.
caseExecute a command conditionally by matching a pattern.
catUsed to concatenate files and print them on the screen.
ccGNU C and C++ compiler.
ccryptUsed for encryption and decryption of data.
cdUsed to change directory.
cdda2wavUsed to rip a CD-ROM and make WAV file.
cdparanoiaRecord audio from CD more reliably using data-verification algorithms.
cdrdaoUsed to write all the content specified to a file to a CD all at once.
cdrecordUsed to record data or audio compact discs.
cfdiskShow or change the disk partition table.
chageUsed to change user password information.
chattrUsed to change file attributes.
chdirUsed to change active working directory.
chfnUsed to change real user name and information.
chgrpUsed to change group ownership for file.
chkconfigManage execution of runlevel services.
chmodChange access permission for a file(s).
chownChange the owner or group for a file.
chpasswdUpdate password in a batch.
chrootRun a command with root directory.
chrtAlter process attributed in real-time.
chshSwitch login shell.
chvtChange foreground virtual terminal.
cksumPerform a CRC checksum for files.
clearUsed to clear the terminal window.
cmpCompare two files (byte by byte).
colFilter reverse (and half-reverse) line feeds from the input.
colcrtFilter nroff output for CRT previewing.
colrmRemove columns from the lines of a file.
columnA utility that formats its input into columns.
commUsed to compare two sorted files line by line.
commandUsed to execute a command with arguments ignoring shell function named command.
compressUsed to compress one or more file(s) and replacing the originals ones.
continueResume the next iteration of a loop.
cpCopy contents of one file to another.
cpioCopy files from and to archives.
cppGNU C language processor.
cronA daemon to execute scheduled commands.
crondSame work as cron.
crontabManage crontab files (containing schedules commands) for users.
csplitSplit a file into sections on the basis of context lines.
ctagsMake a list of functions and macro names defined in a programming source file.
cupsdA scheduler for CUPS.
curlUsed to transfer data from or to a server using supported protocols.
cutUsed to remove sections from each line of a file(s).
cvsConcurrent Versions System. Used to track file versions, allow storage/retrieval of previous versions, and enables multiple users to work on the same file.
- -[⬆ ʀᴇᴛᴜʀɴ ᴛᴏ ᴛᴏᴩ](#table) -

D

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CommandDescription
dateShow system date and time.
dcDesk calculator utility.
ddUsed to convert and copy a file, create disk clone, write disk headers, etc.
ddrescueUsed to recover data from a crashed partition.
deallocvtDeallocates kernel memory for unused virtual consoles.
debugfsFile system debugger for ext2/ext3/ext4
declareUsed to declare variables and assign attributes.
depmodGenerate modules.dep and map files.
devdumpInteractively displays the contents of device or file system ISO.
dfShow disk usage.
diffUsed to compare files line by line.
diff3Compare three files line by line.
digDomain Information Groper, a DNS lookup utility.
dirList the contents of a directory.
dircolorsSet colors for ‘ls’ by altering the LS_COLORS environment variable.
dirnameDisplay pathname after removing the last slash and characters thereafter.
dirsShow the list of remembered directories.
disableRestrict access to a printer.
dlpshInteractive Desktop Link Protocol (DLP) shell for PalmOS.
dmesgExamine and control the kernel ring buffer.
dmidecodeUsed when the user wants to retrieve system’s hardware related information such as Processor, RAM(DIMMs), BIOS detail, etc. of Linux system in a readable format.
dnsdomainnameShow the DNS domain name of the system.
dnssec-keygenGenerate encrypted Secure DNS keys for a given domain name.
dnssec-makekeysetProduce domain key set from one or more DNS security keys generated by dnssec-keygen.
dnssec-signkeySign a secure DNS keyset with key signatures specified in the list of key-identifiers.
dnssec-signzoneSign a secure DNS zonefile with the signatures in the specified list of key-identifiers.
doexecUsed to run an executable with an arbitrary argv list provided.
domainnameShow or set the name of current NIS (Network Information Services) domain.
dosfsckUsed to retrieve information or statistics form components of the system such as network connections, IO devices, or CPU, etc.
dpkgInstall, build, remove and manage debian software packages.
dstatCheck and repair MS-DOS file systems.
duShow disk usage summary for a file(s).
dumpBackup utility for ext2/ext3 file systems.
dumpe2fsDump ext2/ext3/ext4 file systems.
dumpkeysShow information about the keyboard driver’s current translation tables.
- -[⬆ ʀᴇᴛᴜʀɴ ᴛᴏ ᴛᴏᴩ](#table) -

E

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CommandDescription
e2fsckUsed to check ext2/ext3/ext4 file systems.
e2imageStore important ext2/ext3/ext4 filesystem metadata to a file.
e2labelShow or change the label on an ext2/ext3/ext4 filesystem.
echoSend input string(s) to standard output i.e. display text on the screen.
edGNU Ed – a line-oriented text editor.
edquotaUsed to edit filesystem quotas using a text editor, such as vi.
egrepSearch and display text matching a pattern.
ejectEject removable media.
elvtuneUsed to set latency in the elevator algorithm used to schedule I/O activities for specified block devices.
emacsEmacs text editor command line utility.
enableUsed to enable/disable shell builtin commands.
envRun a command in a modified environment. Show/set/delete environment variables.
envsubstSubstitute environment variable values in shell format strings.
esdStart the Enlightenment Sound Daemon (EsounD or esd). Enables multiple applications to access the same audio device simultaneously.
esd-configManage EsounD configuration.
esdcatUse EsounD to send audio data from a specified file.
esdctlEsounD control program.
esddspUsed to reroute non-esd audio data to esd and control all the audio using esd.
esdmonUsed to copy the sound being sent to a device. Also, send it to a secondary device.
esdplayUse EsounD system to play a file.
esdrecUse EsounD to record audio to a specified file.
esdsampleSample audio using esd.
etagsUsed to create a list of functions and macros from a programming source file. These etags are used by emacs. For vi, use ctags.
ethtoolUsed to query and control network driver and hardware settings.
evalUsed to evaluate multiple commands or arguments are once.
exInteractive command
execAn interactive line-based text editor.
exitExit from the terminal.
expandConvert tabs into spaces in a given file and show the output.
expectAn extension to the Tcl script, it’s used to automate interaction with other applications based on their expected output.
exportUsed to set an environment variable.
exprEvaluate expressions and display them on standard output.
- -[⬆ ʀᴇᴛᴜʀɴ ᴛᴏ ᴛᴏᴩ](#table) -

F

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CommandDescription
factorDisplay prime factors of specified integer numbers.
falseDo nothing, unsuccessfully. Exit with a status code indicating failure.
fcUsed to list, edit or re-execute the commands previously entered into an interactive shell.
fc-cacheMake font information cache after scanning the directories.
fc-listShow the list of available fonts.
fdformatDo a low-level format on a floppy disk.
fdiskMake changes to the disk partition table.
fetchmailFetch mail from mail servers and forward it to the local mail delivery system.
fgUsed to send a job to the foreground.
fgconsoleDisplay the number of the current virtual console.
fgrepDisplay lines from a file(s) that match a specified string. A variant of grep.
fileDetermine file type for a file.
findDo a file search in a directory hierarchy.
fingerDisplay user data including the information listed in .planand .projectin each user’s home directory.
fingerdProvides a network interface for the finger program.
flexGenerate programs that perform pattern-matching on text.
fmtUsed to convert text to a specified width by filling lines and removing new lines, displaying the output.
foldWrap input line to fit in a specified width.
forExpand words and run commands for each one in the resultant list.
formailUsed to filter standard input into mailbox format.
formatUsed to format disks.
freeShow free and used system memory.
fsckCheck and repair a Linux file system
ftpFile transfer protocol user interface.
ftpdFTP server process.
functionUsed to define function macros.
FunUsed to draw various type of patterns on the terminal.
fuserFind and kill a process accessing a file.
- -[⬆ ʀᴇᴛᴜʀɴ ᴛᴏ ᴛᴏᴩ](#table) -

G

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CommandDescription
g++Run the g++ compiler.
gawkUsed for pattern scanning and language processing. A GNU implementation of AWK language.
gccA C and C++ compiler by GNU.
gdbA utility to debug programs and know about where it crashes.
getentShows entries from Name Service Switch Libraries for specified keys.
getkeycodesDisplays the kernel scancode-to-keycode mapping table.
getoptsA utility to parse positional parameters.
gpasswdAllows an administrator to change group passwords.
gpgEnables encryption and signing services as per the OpenPGP standard.
gpgsplitUsed to split an OpenPGP message into packets.
gpgvUsed to verify OpenPGP signatures.
gpmIt enables cut and paste functionality and a mouse server for the Linux console.
gprofShows call graph profile data.
grepSearches input files for a given pattern and displays the relevant lines.
groffServes as the front-end of the groff document formatting system.
grofferDisplays groff files and man pages.
groupaddUsed to add a new user group.
groupdelUsed to remove a user group.
groupmodUsed to modify a group definition.
groupsShowthe group(s) to which a user belongs.
grpckVerifies the integrity of group files.
grpconvCreates agshadow file from a group or an already existing gshadow.
gsInvokes Ghostscript, and interpreter and previewer for Adobe’s PostScript and PDF languages.
gunzipA utility to compress/expand files.
gzexeUsed compress executable files in place and have them automatically uncompress and run at a later stage.
gzipA utility to compress/expand files.
- -[⬆ ʀᴇᴛᴜʀɴ ᴛᴏ ᴛᴏᴩ](#table) -

H

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CommandDescription
haltCommand used to half the machine.
hashShows the path for the commands executed in the shell.
hdparmShow/configure parameters for SATA/IDE devices.
headShows first 10 lines from each specified file.
helpDisplay’s help for a built-in command.
hexdumpShows specified file output in hexadecimal, octal, decimal, or ASCII format.
historyShows the command history.
hostA utility to perform DNS lookups.
hostidShows host’s numeric ID in hexadecimal format.
hostnameDisplay/set the hostname of the system.
hostnamectlProvides a proper API used to control Linux system hostname and change its related settings.
htdigestManage the user authentication file used by the Apache web server.
htopAn interactive process viewer for the command line.
hwclockShow or configure the system’s hardware clock.
- -[⬆ ʀᴇᴛᴜʀɴ ᴛᴏ ᴛᴏᴩ](#table) -

I

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CommandDescription
iconvConvert text file from one encoding to another.
idShow user and group information for a specified user.
ifExecute a command conditionally.
ifconfigUsed to configure network interfaces.
ifdownStops a network interface.
iftopIt is a network analyzing tool used by system administrators to view the bandwidth related stats.
ifupStarts a network interface.
imapdAn IMAP (Interactive Mail Access Protocol) server daemon.
importCapture an X server screen and saves it as an image.
inetdExtended internet services daemon, it starts the programs that provide internet services.
infoUsed to read the documentation in Info format.
initSystemd system and service manager.
insmodA program that inserts a module into the Linux kernel.
installUsed to copy files to specified locations and set attributions during the install process.
iostatShows statistics for CPU, I/O devices, partitions, network filesystems.
iotopUsed to display and monitor the disk IO usage details and even gets a table of existing IO utilization by the process.
ipDisplay/manipulate routing, devices, policy, routing and tunnels.
ipcrmUsed to remove System V interprocess communication (IPC) objects and associated data structures.
ipcsShow information on IPC facilities for which calling process has read access.
iptablesAdministration tool for IPv4 packet filtering and NAT.
iptables-restoreUsed to restore IP tables from data specified in the input or a file.
iptables-saveUsed to dump IP table contents to standard output.
iwconfigUsed to display the parameters, and the wireless statistics which are extracted from /proc/net/wireless.
isodumpA utility that shows the content iso9660 images to verify the integrity of directory contents.
isoinfoA utility to perform directory like listings of iso9660 images.
isosizeShow the length of an iso9660 filesystem contained in a specified file.
isovfyVerifies the integrity of an iso9660 image.
ispellA CLI-based spell-check utility.
- -[⬆ ʀᴇᴛᴜʀɴ ᴛᴏ ᴛᴏᴩ](#table) -

J

- - - - - - - - - - - - - - - - - - - - - -
CommandDescription
jobsShow the list of active jobs and their status.
joinFor each pair of input lines, join them using a command field and display on standard output.
journalctlUsed to view systemd, kernal and journal logs.
- -[⬆ ʀᴇᴛᴜʀɴ ᴛᴏ ᴛᴏᴩ](#table) -

K

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CommandDescription
kbd_modeSet a keyboard mode. Without arguments, shows the current keyboard mode.
kbdrateReset keyboard repeat rate and delay time.
killSend a kill (termination) signal to one more processes.
killallKills a process(es) running a specified command.
killall5A SystemV killall command. Kills all the processes excluding the ones which it depends on.
klogdControl and prioritize the kernel messages to be displayed on the console, and log them through syslogd.
kudzuUsed to detect new and enhanced hardware by comparing it with existing database. Only for RHEL and derivatives.
- -[⬆ ʀᴇᴛᴜʀɴ ᴛᴏ ᴛᴏᴩ](#table) -

L

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CommandDescription
lastShows a list of recent logins on the system by fetching data from /var/log/wtmp file.
lastbShows the list of bad login attempts by fetching data from /var/log/btmpfile.
lastlogDisplays information about the most recent login of all users or a specified user.
ldThe Unix linker, it combines archives and object files. It then puts them into one output file, resolving external references.
ldconfigConfigure dynamic linker run-time bindings.
lddShows shared object dependencies.
lessDisplays contents of a fileone page at a time. It’s advanced than more command.
lesskeyUsed to specify key bindings for less command.
letUsed to perform integer artithmetic on shell variables.
lftpAn FTP utility with extra features.
lftpgetUses lftop to retrieve HTTP, FTP, and other protocol URLs supported by lftp.
linkCreate links between two files. Similar to ln command.
lnCreate links between files. Links can be hard (two names for the same file) or soft (a shortcut of the first file).
loadkeysLoad keyboard translation tables.
localUsed to create function variables.
localeShows information about current or all locales.
locateUsed to find files by their name.
lockfileCreate semaphore file(s) which can be used to limit access to a file.
loggerMake entries in the system log.
loginCreate a new session on the system.
lognameShows the login name of the current user.
logoutPerforms the logout operation by making changes to the utmp and wtmp files.
logrotateUsed for automatic rotation, compression, removal, and mailing of system log files.
lookShows any lines in a file containing a given string in the beginning.
losetupSet up and control loop devices.
lpadminUsed to configure printer and class queues provided by CUPS (Common UNIX Printing System).
lpcLine printer control program, it provides limited control over CUPS printer and class queues.
lpinfoShows the list of available devices and drivers known to the CUPS server.
lpmoveMove on or more printing jobs to a new destination.
lpqShows current print queue status for a specified printer.
lprUsed to submit files for printing.
lprintUsed to print a file.
lprintdUsed to abort a print job.
lprintqList the print queue.
lprmCancel print jobs.
lpstatDisplays status information about current classes, jobs, and printers.
lsShows the list of files in the current directory.
lsattrShows file attributes on a Linux ext2 file system.
lsblkLists information about all available or the specified block devices.
lshwUsed to generate the detailed information of the system’s hardware configuration from various files in the /proc directory.
lsmodShow the status of modules in the Linux kernel.
lsofList open files.
lspciList all PCI devices.
lsusbList USB devices.
- -[⬆ ʀᴇᴛᴜʀɴ ᴛᴏ ᴛᴏᴩ](#table) -

M

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CommandDescription
m4Macro processor.
mailUtility to compose, receive, send, forward, and reply to emails.
mailqShows to list all emails queued for delivery (sendmail queue).
mailstatsShows current mail statistics.
mailtoUsed to send mail with multimedia content in MIME format.
makeUtility to maintain groups of programs, recompile them if needed.
makedbmCreates an NIS (Network Information Services) database map.
makemapCreates database maps used by the keyed map lookups in sendmail.
manShows manual pages for Linux commands.
manpathDetermine search path for manual pages.
mattribUsed to change MS-DOS file attribute flags.
mbadblocksChecks MD-DOS filesystems for bad blocks.
mcatDump raw disk image.
mcdUsed to change MS-DOS directory.
mcopyUsed to copy MS-DOS files from or to Unix.
md5sumUsed to check MD5 checksum for a file.
mdel, mdeltreeUsed to delete MS-DOS file. mdeltree recursively deletes MS-DOS directory and its contents.
mdirUsed to display an MS-DOS directory.
mduUsed to display the amount of space occupied by an MS-DOS directory.
mergeThree-way file merge. Includes all changes from file2 and file3 to file1.
mesgAllow/disallow osends to sedn write messages to your terminal.
metamailFor sending and showing rich text or multimedia email using MIME typing metadata.
metasendAn interface for sending non-text mail.
mformatUsed to add an MS-DOS filesystem to a low-level formatted floppy disk.
mimencodeTranslate to/from MIME multimedia mail encoding formats.
minfoDisplay parameters of an MS-DOS filesystem.
mkdirUsed to create directories.
mkdosfsUsed to create an MS-DOS filesystem under Linux.
mke2fsUsed create an ext2/ext3/ext4 filesystem.
mkfifoUsed to create named pipes (FIFOs) with the given names.
mkfsUsed to build a Linux filesystem on a hard disk partition.
mkfs.ext3Same as mke2fs, create an ext3 Linux filesystem.
mkisofsUsed to create an ISO9660/JOLIET/HFS hybrid filesystem.
mklost+foundCreate a lost+found directory on a mounted ext2 filesystem.
mkmanifestMakes alist of file names and their DOS 8.3 equivalent.
mknodCreate a FIFO, block (buffered) special file, character (unbuffered) special file with the specified name.
mkraidUsed to setup RAID device arrays.
mkswapSet up a Linux swap area.
mktempCreate a temporary file or directory.
mlabelMake an MD-DOS volume label.
mmdMake an MS-DOS subdirectory.
mmountMount an MS-DOS disk.
mmoveMove or rename an MS-DOS file or subdirectory.
mmvMass move and rename files.
modinfoShow information about a Linux kernel module.
modprobeAdd or remove modules from the Linux kernel.
moreDisplay content of a file page-by-page.
mostBrowse or page through a text file.
mountMount a filesystem.
mountdNFS mount daemon.
mpartitionUsed to report processor related statistics.
mpstatPartition an MS-DOS disk.
mpg123Command-line mp3 player.
mpg321Similar to mpg123.
mrdRemove an MS-DOS subdirectory.
mrenRename an existing MS-DOS file.
mshowfatShow FTA clusters allocated to a file.
mtControl magnetic tape drive operation.
mtoolsUtilities to access MS-DOS disks.
mtoolstestTests and displays the mtools configuration files.
mtrA network diagnostic tool.
mtypeDisplay contents of an MS-DOS file.
mvMove/rename files or directories.
mzipChange protection mode and eject disk on Zip/Jaz drive.
- -[⬆ ʀᴇᴛᴜʀɴ ᴛᴏ ᴛᴏᴩ](#table) -

N

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CommandDescription
namedInternet domain name server.
nameiFollow a pathname until a terminal point is found.
nameifName network interfaces based on MAC addresses.
ncNetcat utility. Arbitrary TCP and UDP connections and listens.
netstatShow network information.
newaliasesRebuilds mail alias database.
newgrpLog-in to a new group.
newusersUpdate/create new users in batch.
nfsdSpecial filesystem for controlling Linux NFS server.
nfsstatList NFS statistics.
niceRun a program with modified scheduling priority.
nlShow numbered line while displaying the contents of a file.
nmList symbols from object files.
nohupRun a command immune to hangups.
notify-sendA program to send desktop notifications.
nslookupUsed performs DNS queries. Read this article for more info.
nsupdateDynamic DNS update utility.
- -[⬆ ʀᴇᴛᴜʀɴ ᴛᴏ ᴛᴏᴩ](#table) -

O

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CommandDescription
objcopyCopy and translate object files.
objdumpDisplay information from object files.
odDump files in octal and other formats.
opOperator access, allows system administrators to grant users access to certain root operations that require superuser privileges.
openOpen a file using its default application.
openvtStart a program on a new virtual terminal (VT).
- -[⬆ ʀᴇᴛᴜʀɴ ᴛᴏ ᴛᴏᴩ](#table) -

P

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CommandDescription
passwdChange user password.
pasteMerge lines of files. Write to standard output, TAB-separated lines consisting of sequentially corresponding lines from each file.
patchApply a patchfile (containing differences listing by diff program) to an original file.
pathchkCheck if file names are valid or portable.
perlPerl 5 language interpreter.
pgrepList process IDs matching the specified criteria among all the running processes.
pidofFind process ID of a running program.
pingSend ICMP ECHO_REQUEST to network hosts.
pinkyLightweight finger.
pkillSend kill signal to processes based on name and other attributes.
pmapReport memory map of a process.
popdRemoves directory on the head of the directory stack and takes you to the new directory on the head.
portmapConverts RPC program numbers to IP port numbers.
poweroffShuts down the machine.
pppdPoint-to-point protocol daemon.
prConvert (column or paginate) text files for printing.
praliasesPrints the current system mail aliases.
printcapPrinter capability database.
printenvShow values of all or specified environment variables.
printfShow arguments formatted according to a specified format.
psReport a snapshot of the current processes.
ptxProduce a permuted index of file contents.
pushdAppends a given directory name to the head of the stack and then cd to the given directory.
pvMonitor progress of data through a pipe.
pwckVerify integrity of password files.
pwconvCreates shadow from passwd and an optionally existing shadow.
pwdShow current directory.
pythonComputer programming language often used to build websites and software, automate tasks, and conduct data analysis.
- -[⬆ ʀᴇᴛᴜʀɴ ᴛᴏ ᴛᴏᴩ](#table) -

Q

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CommandDescription
quotaShows disk usage, and space limits for a user or group. Without arguments, only shows user quotas.
quotacheckUsed to scan a file system for disk usage.
quotactlMake changes to disk quotas.
quotaoffEnable enforcement of filesystem quotas.
quotaonDisable enforcement of filesystem quotas.
quotastatsShows the report of quota system statistics gathered from the kernel.
- -[⬆ ʀᴇᴛᴜʀɴ ᴛᴏ ᴛᴏᴩ](#table) -

R

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CommandDescription
raidstartStart/stop RAID devices.
ramRAM disk device used to access the RAM disk in raw mode.
ramsizeShow usage information for the RAM disk.
ranlibGenerate index to the contents of an archive and store it in the archive.
rarCreate and manage RAR file in Linux.
rarpdRespond to Reverse Address Resolution Protocol (RARP) requests.
rcpRemote copy command to copy files between remote computers.
rdateSet system date and time by fetching information from a remote machine.
rdevSet or query RAM disk size, image root device, or video mode.
rdistRemote file distribution client, maintains identical file copies over multiple hosts.
rdistdStart the rdist server.
readRead from a file descriptor.
readarrayRead lines from a file into an array variable.
readcdRead/write compact disks.
readelfShows information about ELF (Executable and Linkable format) files.
readlinkDisplay value of a symbolic link or canonical file name.
readonlyMark functions and variables as read-only.
rebootRestart the machine.
rejectAccept/reject print jobs sent to a specified destination.
remsyncSynchronize remote files over email.
renameRename one or more files.
reniceChange priority of active processes.
repquotaReport disk usage and quotas for a specified filesystem.
resetReinitialize the terminal.
resize2fsUsed to resize ext2/ext3/ext4 file systems.
restoreRestore files from a backup created using dump.
returnExit a shell function.
revShow contents of a file, reversing the order of characters in every line.
rexecRemote execution client for exec server.
rexecdRemote execution server.
richtextView “richtext” on an ACSII terminal.
rloginUsed to connect a local host system with a remote host.
rlogindActs as the server for rlogin.It facilitates remote login, and authentication based on privileged port numbers from trusted hosts.
rmRemoves specified files and directories (not by default).
rmailHandle remote mail received via uucp.
rmdirUsed to remove empty directories.
rmmodA program to remove modules from Linux kernel.
rndcName server control utility. Send command to a BIND DNS server over a TCP connection.
rootflagsShow/set flags for the kernel image.
routeShow/change IP routing table.
routedA daemon, invoked at boot time, to manage internet routing tables.
rpcgenAn RPC protocol compiler. Parse a file written in the RPC language.
rpcinfoShows RPC information. Makes an RPC call to an RPC server and reports the findings.
rpmA package manager for Linux distributions. Originally developed for RedHat Linux.
rshRemote shell. Connects to a specified host and executes commands.
rshdA daemon that acts as a server for rsh and rcp commands.
rsyncA versitile to for copying files remotely and locally.
runlevelShows previous and current SysV runlevel.
rupRemote status display. Shows current system status for all or specified hosts on the local network.
ruptimeShows uptime and login details of the machines on the local network.
rusersShows the list of the users logged-in to the host or on all machines on the local network.
rusersdThe rsuerd daemon acts as a server that responds to the queries from rsuers command.
rwallSends messages to all users on the local network.
rwhoReports who is logged-in to the hosts on the local network.
rwhodActs as a server for rwho and ruptime commands.
- -[⬆ ʀᴇᴛᴜʀɴ ᴛᴏ ᴛᴏᴩ](#table) -

S

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CommandDescription
sane-find-scannerFind SCSI and USB scanner and determine their device files.
sarUsed to monitor Linux system’s resources like CPU usage, Memory utilization, I/O devices consumption, etc..
scanadfRetrieve multiple images from a scanner equipped with an automatic document feeder (ADF).
scanimageRead images from image acquisition devices (scanner or camera) and display on standard output in PNM (Portable aNyMap) format.
scpCopy files between hosts on a network securely using SSH.
screenA window manager that enables multiple pseudo-terminals with the help of ANSI/VT100 terminal emulation.
scriptUsed to make a typescript of everything displayed on the screen during a terminal session.
scriptreplayUsed to replay a typescript/terminal_activity stored in the log file that was recorded by the script command.
sdiffShows two files side-by-side and highlights the differences.
sedStream editor for filtering and transforming text (from a file or a pipe input).
selectSynchronous I/O multiplexing.
sendmailIt’s a mail router or an MTA (Mail Transfer Agent). sendmail support can send a mail to one or more recipients using necessary protocols.
sensorsShows the current readings of all sensor chips.
seqDisplays an incremental sequence of numbers from first to last.
serviceThis command is used to manage system services.
setUsed to manipulate shell variables and functions.
setfdprmSets floppy disk parameters as provided by the user.
setkeycodesLoad kernel scancode-to-keycode mapping table entries.
setledsShow/change LED light settings of the keyboard.
setmetamodeDefine keyboard meta key handling. Without arguments, shows current meta key mode.
setquotaSet disk quotas for users and groups.
setsidRun a program in a new session.
settermSet terminal attributes.
sftpSecure File Transfer program.
shCommand interpreter (shell) utility.
sha1sumCompute and check 160-bit SHA1 checksum to verify file integrity.
shiftShift positional parameters.
shoptShell options.
showkeyExamines codes sent by the keyboard displays them in printable form.
showmountShows information about NFS server mount on the host.
shredOverwrite a file to hide its content (optionally delete it), making it harder to recover it.
shutdownPower-off the machine.
sizeLists section size and the total size of a specified file.
skillSend a signal to processes.
slabtopShow kernel slab cache information in real-time.
slattachAttack a network interface to a serial line.
sleepSuspend execution for a specified amount of time (in seconds).
slocateDisplay matches by searching filename databases. Takes ownership and file permission into consideration.
sniceReset priority for processes.
sortSort lines of text files.
sourceRun commands from a specified file.
splitSplit a file into pieces of fixed size.
ssDisplay socket statistics, similar to netstat.
sshAn SSH client for logging in to a remote machine. It provides encrypted communication between the hosts.
ssh-addAdds private key identities to the authentication agent.
ssh-agentIt holds private keys used for public key authentication.
ssh-keygenIt generates, manages, converts authentication keys for ssh.
ssh-keyscanGather ssh public keys.
sshdServer for the ssh program.
statDisplay file or filesystem status.
statdA daemon that listens for reboot notifications from other hosts, and manages the list of hosts to be notified when the local system reboots.
straceTrace system calls and signals.
strfileCreate a random access file for storing strings.
stringsSearch a specified file and prints any printable strings with at least four characters and followed by an unprintable character.
stripDiscard symbols from object files.
sttyChange and print terminal line settings.
suChange user ID or become superuser.
sudoExecute a command as superuser.
sumChecksum and count the block in a file.
suspendSuspend the execution of the current shell.
swapoffDisable devices for paging and swapping.
swaponEnable devices for paging and swapping.
symlinkCreate a symbolic link to a file.
syncSynchronize cached writes to persistent storage.
sysctlConfigure kernel parameters at runtime.
sysklogdLinux system logging utilities. Provides syslogd and klogd functionalities.
syslogdRead and log system messages to the system console and log files.
systemctlThis command can be used to start, stop, and check the status of system services.
- -[⬆ ʀᴇᴛᴜʀɴ ᴛᴏ ᴛᴏᴩ](#table) -

T

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CommandDescription
tacConcatenate and print files in reverse order. Opposite of cat command.
tailShow the last 10 lines of each specified file(s).
tailfFollow the growth of a log file. (Deprecated command)
talkA two-way screen-oriented communication utility that allows two user to exchange messages simultaneously.
talkdA remote user communication server for talk.
tarGNU version of the tar archiving utility. Used to store and extract multiple files from a single archive.
tasksetSet/retrieve a process’s CPU affinity.
tcpdAccess control utility for internet services.
tcpdumpDump traffic on network. Displays a description of the contents of packets on a network interface that match the boolean expression.
tcpsliceExtract pieces of tcpdump files or merge them.
teeRead from standard input and write to standard output and files.
telinitChange SysV runlevel.
telnetTelnet protocol user interface. Used to interact with another host using telnet.
telnetdA server for the telnet protocol.
testCheck file type and compare values.
tftpUser interface to the internet TFTP (Trivial File Transfer Protocol).
tftpdTFTP server.
timeRun programs and summarize system resource usage.
timeoutExecute a command with a time limit.
timesShows accumulated user and system times for the shell and it’s child processes.
tloadShows a graph of the current system load average to the specified tty.
tmpwatchRecursively remove files and directories which haven’t been accessed for the specified period of time.
topDisplays real-time view of processes running on the system.
touchChange file access and modification times.
tputModify terminal-dependent capabilities, color, etc.
trTranslate, squeeze, or delete characters from standard input and display on standard output.
tracepathTraces path to a network host discovering MTU (Maximum Transmission Unit) along this path.
tracerouteTraces the route taken by the packets to reach the network host.
trapTrap function responds to hardware signals. It defines and creates handlers to run when the shell receives signals.
treeA recursive directory listing program that produces a depth-indented listing of files.
troffThe troff processor of the groff text formatting system.
TRUEExit with a status code indicating success.
tsetInitialize terminal.
tsortPerform topological sort.
ttyDisplay the filename of the terminal connected to standard input.
tune2fsAdjust tuneable filesystem parameters on ext2/ext3/ext4 filesystems.
tunelpSet various parameters for the line printer devices.
typeWrite a description for a command type.
- -[⬆ ʀᴇᴛᴜʀɴ ᴛᴏ ᴛᴏᴩ](#table) -

U

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CommandDescription
ulUnderline text.
ulimitGet and set user limits for the calling process.
umaskSet file mode creation mask.
umountUnmount specified file systems.
unaliasRemove alias definitions for specified alias names.
unameShow system information.
uncompressUncompress the files compressed with the compress command.
unexpandConvert spaces to tabs for a specified file.
unicode_startPut keyboard and console in Unicode mode.
unicode_stopRevert keyboard and console from Unicode mode.
uniqReport or omit repeating lines.
unitsConvert units from one scalar to another.
unix2dosConverts a Unix text file to DOS format.
unrarExtract files from a RAR archive.
unsetRemove variable or function names.
unsharUnpack shell archive scripts.
untilExecute command until a given condition is true.
uptimeTell how long the system has been running.
useraddCreate a new user or update default user information.
userdelDelete a user account and related files.
usermodModify a user account.
usernameIt provides a set of commands to fetch username and its configurations from the Linux host.
usersShow the list of active users on the machine.
usleepSuspend execution for microsecond intervals.
uudecodeDecode a binary file.
uuencodeEncode a binary file.
uuidgenCreated a new UUID (Universally Unique Identifier) table.
- -[⬆ ʀᴇᴛᴜʀɴ ᴛᴏ ᴛᴏᴩ](#table) -

V

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CommandDescription
vdirSame as ls -l -b. Verbosely list directory contents.
viA text editor utility.
vidmodeSet the video mode for a kernel image. Displays current mode value without arguments. Alternative: rdev -v
vimVi Improved, a text-based editor which is a successor to vi.
vmstatShows information about processes, memory, paging, block IO, traps, disks, and CPU activity.
vnstatUsed by system administrators in order to monitor network parameters such as bandwidth consumption or maybe some traffic flowing in or out.
volnameReturns volume name for a device formatted with an ISO-9660 filesystem. For example, CD-ROM.
- -[⬆ ʀᴇᴛᴜʀɴ ᴛᴏ ᴛᴏᴩ](#table) -

W

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CommandDescription
wShow who is logged-on and what they’re doing.
waitWaits for a specified process ID(s) to terminate and returns the termination status.
wallDisplay a message on the terminals all the users who are currently logged-in.
warnquotaSend mail to the users who’ve exceeded their disk quota soft limit.
watchRuns commands repeatedly until interrupted and shows their output and errors.
wcPrint newline, word, and byte count for each of the specified files.
wgetA non-interactive file download utility.
whatisDisplay one line manual page descriptions.
whereisLocate the binary, source, and man page files for a command.
whichFor a given command, lists the pathnames for the files which would be executed when the command runs.
whileConditionally execute commands (while loop).
whoShows who is logged on.
whoamiDisplays the username tied to the current effective user ID.
whoisLooks for an object in a WHOIS database
writeDisplay a message on other user’s terminal.
- -[⬆ ʀᴇᴛᴜʀɴ ᴛᴏ ᴛᴏᴩ](#table) -

X

- - - - - - - - - - - - - - - - - - - - - - - - - -
CommandDescription
xargsRuns a command using initial arguments and then reads remaining arguments from standard input.
xdg-openUsed to open a file or URL in an application preferred by the user.
xinetdExtended internet services daemon. Works similar to inetd.
xzCompress/ Decompress .xz and .lzma files.
- -[⬆ ʀᴇᴛᴜʀɴ ᴛᴏ ᴛᴏᴩ](#table) -

Y

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CommandDescription
yaccYet Another Compiler Compiler, a GNU Project parser generator.
yesRepeatedly output a line with a specified string(s) until killed.
ypbindA daemon that helps client processes to connect to an NIS server.
ypcatShows the NIS map (or database) for the specified MapName parameter.
ypinitSets up NIS maps on an NIS server.
ypmatchShows values for specified keys from an NIS map.
yppasswdChange NIS login password.
yppasswddActs as a server for the yppasswd command. Receives and executes requests.
yppollShows the ID number or version of NIS map currently used on the NIS server.
yppushForces slave NIS servers to copy updated NIS maps.
ypservA daemon activated at system startup. It looks for information in local NIS maps.
ypsetPoint a client (running ypbind) to a specific server (running ypserv).
yptestCalls various functions to check the configuration of NIS services.
ypwhichShows the hostname for NIS server or master server for a given map.
ypxfrTransfers NIS server map from server to a local host.
- -[⬆ ʀᴇᴛᴜʀɴ ᴛᴏ ᴛᴏᴩ](#table) -

Z

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CommandDescription
zcatUsed to compress/uncompress files. Similar to gzip
zcmpCompare compressed files.
zdiffCompare compressed files line by line.
zdumpDisplays time for the timezone mentioned.
zforceAdds .gz extension to all gzipped files.
zgrepPerforms grep on compressed files.
zicCreates time conversion information files using the specified input files.
zipA file compression and packaging utility.
zlessDisplays information of a compressed file (using less command) on the terminal one screen at a time.
zmoreDisplays output of a compressed file (using more command) on the terminal one page at a time.
znewRecompress .z files to .gz. files.
- -

-Credits: fossbytes & geeksforgeeks

- -[⬆ ʀᴇᴛᴜʀɴ ᴛᴏ ᴛᴏᴩ](#table) -

-
- -
Quick cheatsheet Memo -

- ->**Note** 💡
- -> - A single hyphen `-` is used to represent a short option, such as `-a`.
-> - A double hyphen `--` is used to denote a long option, such as `--all`.
-> - Example command : `ls -a|--all` (List all directories). Can use either use the short or long options. - -> - Both short and long options were incorporated for educational purposes, allowing users to choose the preferred format.
-> - It's important to note that not all commands have both short and long options. Some commands may only have short options, while others may only have long options. - -### Contents -- [Command Information](#command-information) -- [Command History](#command-history) -- [Navigating Directories](#navigating-directories) -- [Creating Directories](#creating-directories) -- [Moving Directories](#moving-directories) -- [Deleting Directories](#deleting-directories) -- [Creating Files](#creating-files) -- [Standard Output, Error and Input](#standard-output-standard-error-and-standard-input) -- [Moving Files](#moving-files) -- [Deleting Files](#deleting-files) -- [Reading Files](#reading-files) -- [Sorting Files](#sorting-files) -- [File Permissions](#file-permissions) -- [Finding Files](#finding-files) -- [Find in Files](#find-in-files) -- [Replace in Files](#replace-in-files) -- [File Editor](#file-editor) -- [Symbolic Links](#symbolic-links) -- [Compressing Files](#compressing-files) -- [Decompressing Files](#decompressing-files) -- [Packages](#packages) -- [Disk Usage](#disk-usage) -- [Memory Usage](#memory-usage) -- [Shutdown and Reboot](#shutdown-and-reboot) -- [Identifying Processes](#identifying-processes) -- [Process Priority](#process-priority) -- [Killing Processes](#killing-processes) -- [Date & Time](#date--time) -- [Scheduled Tasks](#scheduled-tasks) -- [User Mangement](#user-management) -- [HTTP Requests](#http-requests) -- [Network Troubleshooting](#network-troubleshooting) -- [DNS](#dns) -- [Hardware](#hardware) -- [System Information](#system-information) -- [Terminal Multiplexers](#terminal-multiplexers) -- [Secure Shell Protocol (SSH)](#secure-shell-protocol-ssh) -- [Secure Copy](#secure-copy) -- [Bash Profile](#bash-profile) -- [Bash Script](#bash-script) -# - -## Command Information - -```bash -man chmod # Display page manual of a command -man -f|--whatis chmod # Display short description about a command -man -k|--apropos permission # Display all related commands from a specific keyword - -chmod --help # Display usage options of a command -``` -[⬆ ʀᴇᴛᴜʀɴ ᴛᴏ ᴄᴏɴᴛᴇɴᴛꜱ](#contents) - -## Command History - -```bash -history # View all previous commands -history | grep foo # View the commands using a specific word -history | grep -E|--extended-regexp -i|--ignore-case 'foo1|foo2|foo3' # View the commands using more than 1 specific word(case sensitive) -history | head -n|--lines 3 # View the first 3 executed commands -history 3 # View the last 3 executed commands -history -d 99 # Clear a command from a specific line -history -c # Clears all history commands -!! # Run the last command executed - -touch foo.sh # <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<┐ -chmod +x !$ # !$ is the last argument of the last command i.e. foo.sh <<<<┘ -``` -[⬆ ʀᴇᴛᴜʀɴ ᴛᴏ ᴄᴏɴᴛᴇɴᴛꜱ](#contents) - -## Navigating Directories - -```bash -pwd # Print current directory path -ls # List directories -ls -a|--all # List directories including hidden -ls -l # List directories in long form -ls -l -h|--human-readable # List directories in long form with human readable sizes -ls -t # List directories by modification time, newest first -stat foo.txt # List size, created and modified timestamps for a file -stat foo # List size, created and modified timestamps for a directory -tree # List directory and file tree -tree -a # List directory and file tree including hidden -tree -d # List directory tree - -cd foo # Go to foo sub-directory -cd # Go to home directory -cd ~ # Go to home directory -cd - # Go to the previously chosen directory -pushd foo # Go to foo sub-directory and add previous directory to stack -popd # Go back to directory in stack saved by `pushd` -``` -[⬆ ʀᴇᴛᴜʀɴ ᴛᴏ ᴄᴏɴᴛᴇɴᴛꜱ](#contents) - -## Creating Directories - -```bash -mkdir foo # Create a directory -mkdir foo bar # Create multiple directories -mkdir -p|--parents foo/bar # Create nested directory -mkdir -p|--parents {foo,bar}/baz # Create multiple nested directories - -mktemp -d|--directory # Create a temporary directory -``` -[⬆ ʀᴇᴛᴜʀɴ ᴛᴏ ᴄᴏɴᴛᴇɴᴛꜱ](#contents) - -## Moving Directories - -```bash -cp -R|--recursive foo bar # Copy directory -mv foo bar # Move directory - -rsync -z|--compress -v|--verbose /foo /bar # Copy directory, overwrites destination -rsync --ignore-existing -a|--archive -z|--compress -v|--verbose /foo /bar # Copy directory, without overwriting destination -rsync -avz /foo username@hostname:/bar # Copy local directory to remote directory -rsync -avz username@hostname:/foo /bar # Copy remote directory to local directory -``` -[⬆ ʀᴇᴛᴜʀɴ ᴛᴏ ᴄᴏɴᴛᴇɴᴛꜱ](#contents) - -## Deleting Directories - -```bash -rmdir foo # Delete non-empty directory -rm -r|--recursive foo # Delete directory including contents -rm -r|--recursive -f|--force foo # Delete directory including contents, ignore nonexistent files and never prompt -``` -[⬆ ʀᴇᴛᴜʀɴ ᴛᴏ ᴄᴏɴᴛᴇɴᴛꜱ](#contents) - -## Creating Files - -```bash -touch foo.txt # Create file or update existing files modified timestamp -touch foo.txt bar.txt # Create multiple files -touch {foo,bar}.txt # Create multiple files -touch test{1..3} # Create test1, test2 and test3 files -touch test{a..c} # Create testa, testb and testc files - -mktemp # Create a temporary file -``` -[⬆ ʀᴇᴛᴜʀɴ ᴛᴏ ᴄᴏɴᴛᴇɴᴛꜱ](#contents) - -## Standard Output, Standard Error and Standard Input - -```bash -echo "foo" > bar.txt # Overwrite file with content -echo "foo" >> bar.txt # Append to file with content - -ls exists 1> stdout.txt # Redirect the standard output to a file -ls noexist 2> stderror.txt # Redirect the standard error output to a file -ls > out.txt 2>&1 # Redirect standard output and error to a file -ls > /dev/null # Discard standard output and error - -read foo # Read from standard input and write to the variable foo -``` -[⬆ ʀᴇᴛᴜʀɴ ᴛᴏ ᴄᴏɴᴛᴇɴᴛꜱ](#contents) - -## Moving Files - -```bash -cp foo.txt bar.txt # Copy file -mv foo.txt bar.txt # Move file - -rsync -z|--compress -v|--verbose /foo.txt /bar # Copy file quickly if not changed -rsync -z|--compress -v|--verbose /foo.txt /bar.txt # Copy and rename file quickly if not changed -``` -[⬆ ʀᴇᴛᴜʀɴ ᴛᴏ ᴄᴏɴᴛᴇɴᴛꜱ](#contents) - -## Deleting Files - -```bash -rm foo.txt # Delete file -rm -f|--force foo.txt # Delete file, ignore nonexistent files and never prompt -``` -[⬆ ʀᴇᴛᴜʀɴ ᴛᴏ ᴄᴏɴᴛᴇɴᴛꜱ](#contents) - -## Reading Files - -```bash -cat foo.txt # Print all contents -less foo.txt # Print some contents at a time (g - go to top of file, SHIFT+g, go to bottom of file, /foo to search for 'foo') -head foo.txt # Print top 10 lines of file -tail foo.txt # Print bottom 10 lines of file -tail -f|--follow foo.txt # Print bottom 10 lines of file updating with new data -open foo.txt # Open file in the default editor -wc foo.txt # List number of lines words and characters in the file -``` -[⬆ ʀᴇᴛᴜʀɴ ᴛᴏ ᴄᴏɴᴛᴇɴᴛꜱ](#contents) - -## Sorting Files - -```bash -sort foo.txt # Sort file (ascending order) -sort -r|--reverse foo.txt # Sort file (descending order) -sort -n|--numeric-sort foo.txt # Sort numbers instead of strings -sort -t|--field-separator: -k 3n /foo/foo.txt # Sort by the third column of a file - -``` -[⬆ ʀᴇᴛᴜʀɴ ᴛᴏ ᴄᴏɴᴛᴇɴᴛꜱ](#contents) - -## File Permissions - -| # | Permission | rwx | Binary | -| - | - | - | - | -| 7 | read, write and execute | rwx | 111 | -| 6 | read and write | rw- | 110 | -| 5 | read and execute | r-x | 101 | -| 4 | read only | r-- | 100 | -| 3 | write and execute | -wx | 011 | -| 2 | write only | -w- | 010 | -| 1 | execute only | --x | 001 | -| 0 | none | --- | 000 | - -For a directory, execute means you can enter a directory. - -| User | Group | Others | Description | -| - | - | - | - | -| 6 | 4 | 4 | User can read and write, everyone else can read (Default file permissions) | -| 7 | 5 | 5 | User can read, write and execute, everyone else can read and execute (Default directory permissions) | - -- u - User -- g - Group -- o - Others -- a - All of the above - -```bash -ls -l /foo.sh # List file permissions -chmod +100 foo.sh # Add 1 to the user permission -chmod -100 foo.sh # Subtract 1 from the user permission -chmod u+x foo.sh # Give the user execute permission -chmod g+x foo.sh # Give the group execute permission -chmod u-x,g-x foo.sh # Take away the user and group execute permission -chmod u+x,g+x,o+x foo.sh # Give everybody execute permission -chmod a+x foo.sh # Give everybody execute permission -chmod +x foo.sh # Give everybody execute permission -``` -[⬆ ʀᴇᴛᴜʀɴ ᴛᴏ ᴄᴏɴᴛᴇɴᴛꜱ](#contents) - -## Finding Files - -Find binary files for a command. - -```bash -type -a wget # Display all locations of executable -which -a wget # Display all locations of executables -whereis wget # Find the binary, source, and manual page files -``` - -`locate` uses an index and is fast. - -```bash -updatedb # Update the index - -locate foo.txt # Find a file -locate --ignore-case # Find a file and ignore case -locate f*.txt # Find a text file starting with 'f' -``` - -`find` doesn't use an index and is slow. - -```bash -find /path -name foo.txt # Find a file -find /path -iname foo.txt # Find a file with case insensitive search -find /path -name "*.txt" # Find all text files -find /path -name foo.txt -delete # Find a file and delete it -find /path -name "*.png" -exec pngquant {} # Find all .png files and execute pngquant on it -find /path -type f -name foo.txt # Find a file -find /path -type d -name foo # Find a directory -find /path -type l -name foo.txt # Find a symbolic link -find /path -type f -mtime +30 # Find files that haven't been modified in 30 days -find /path -type f -mtime +30 -delete # Delete files that haven't been modified in 30 days -``` -[⬆ ʀᴇᴛᴜʀɴ ᴛᴏ ᴄᴏɴᴛᴇɴᴛꜱ](#contents) - -## Find in Files - -```bash -grep 'foo' /bar.txt # Search for 'foo' in file 'bar.txt' -grep 'foo' /bar -r|--recursive # Search for 'foo' in directory 'bar' -grep 'foo' /bar -R|--dereference-recursive # Search for 'foo' in directory 'bar' and follow symbolic links -grep 'foo' /bar -l|--files-with-matches # Show only files that match -grep 'foo' /bar -L|--files-without-match # Show only files that don't match -grep 'Foo' /bar -i|--ignore-case # Case insensitive search -grep 'foo' /bar -x|--line-regexp # Match the entire line -grep 'foo' /bar -C|--context 1 # Add N line of context above and below each search result -grep 'foo' /bar -v|--invert-match # Show only lines that don't match -grep 'foo' /bar -c|--count # Count the number lines that match -grep 'foo' /bar -n|--line-number # Add line numbers -grep 'foo' /bar --colour # Add colour to output -grep 'foo\|bar' /baz -R # Search for 'foo' or 'bar' in directory 'baz' -grep --extended-regexp|-E 'foo|bar' /baz -R # Use regular expressions -grep -E 'foo|bar' /baz -R # Use regular expressions -``` - -### Replace in Files - -```bash -sed 's/fox/bear/g' foo.txt # Replace fox with bear in foo.txt and output to console -sed 's/fox/bear/gi' foo.txt # Replace fox (case insensitive) with bear in foo.txt and output to console -sed 's/red fox/blue bear/g' foo.txt # Replace red with blue and fox with bear in foo.txt and output to console -sed 's/fox/bear/g' foo.txt > bar.txt # Replace fox with bear in foo.txt and save in bar.txt -sed -i|--in-place 's/fox/bear/g' foo.txt # Replace fox with bear and overwrite foo.txt -sed -i|--in-place '/red fox/i\blue bear' foo.txt # Insert blue bear before red fox and overwrite foo.txt -sed -i|--in-place '/red fox/a\blue bear' foo.txt # Insert blue bear after red fox and overwrite foo.txt -sed -i|--in-place '10s/find/replace/' foo.txt # Replace the 10th line of the file -sed -i|--in-place '10,20s/find/replace/' foo.txt # Replace in the file 10-20 lines -``` -[⬆ ʀᴇᴛᴜʀɴ ᴛᴏ ᴄᴏɴᴛᴇɴᴛꜱ](#contents) - -### File Editor - - ```bash -nano # Open a new file in nano -nano foo.txt # Open a specific file -nano -m|--mouse foo.txt # Enable the use of the mouse -nano -l|--linenumbers foo.txt # Show line numbers in front of the text -nano +line,10 foo.txt # Open file positioning the cursor at the specified line and column -nano -B|--backup foo.txt # Create a backup file (`foo~`) when saving edits -``` - -[⬆ ʀᴇᴛᴜʀɴ ᴛᴏ ᴄᴏɴᴛᴇɴᴛꜱ](#contents) - -## Symbolic Links - -```bash -ln -s|--symbolic foo bar # Create a link 'bar' to the 'foo' folder -ln -s|--symbolic -f|--force foo bar # Overwrite an existing symbolic link 'bar' -ls -l # Show where symbolic links are pointing -``` -[⬆ ʀᴇᴛᴜʀɴ ᴛᴏ ᴄᴏɴᴛᴇɴᴛꜱ](#contents) - -## Compressing Files - -### zip - -Compresses one or more files into *.zip files. - -```bash -zip foo.zip /bar.txt # Compress bar.txt into foo.zip -zip foo.zip /bar.txt /baz.txt # Compress bar.txt and baz.txt into foo.zip -zip foo.zip /{bar,baz}.txt # Compress bar.txt and baz.txt into foo.zip -zip -r|--recurse-paths foo.zip /bar # Compress directory bar into foo.zip -``` - -### gzip - -Compresses a single file into *.gz files. - -```bash -gzip /bar.txt foo.gz # Compress bar.txt into foo.gz and then delete bar.txt -gzip -k|--keep /bar.txt foo.gz # Compress bar.txt into foo.gz -``` - -### tar -c - -Compresses (optionally) and combines one or more files into a single *.tar, *.tar.gz, *.tpz or *.tgz file. - -```bash -tar -c|--create -z|--gzip -f|--file=foo.tgz /bar.txt /baz.txt # Compress bar.txt and baz.txt into foo.tgz -tar -c|--create -z|--gzip -f|--file=foo.tgz /{bar,baz}.txt # Compress bar.txt and baz.txt into foo.tgz -tar -c|--create -z|--gzip -f|--file=foo.tgz /bar # Compress directory bar into foo.tgz -``` -[⬆ ʀᴇᴛᴜʀɴ ᴛᴏ ᴄᴏɴᴛᴇɴᴛꜱ](#contents) - -## Decompressing Files - -### unzip - -```bash -unzip foo.zip # Unzip foo.zip into current directory -``` - -### gunzip - -```bash -gunzip foo.gz # Unzip foo.gz into current directory and delete foo.gz -gunzip -k|--keep foo.gz # Unzip foo.gz into current directory -``` - -### tar -x - -```bash -tar -x|--extract -z|--gzip -f|--file=foo.tar.gz # Un-compress foo.tar.gz into current directory -tar -x|--extract -f|--file=foo.tar # Un-combine foo.tar into current directory -``` -[⬆ ʀᴇᴛᴜʀɴ ᴛᴏ ᴄᴏɴᴛᴇɴᴛꜱ](#contents) - -## Packages - -```bash -apt update # Refreshes repository index -apt search wget # Search for a package -apt show wget # List information about the wget package -apt list --all-versions wget # List all versions of the package -apt install wget # Install the latest version of the wget package -apt install wget=1.2.3 # Install a specific version of the wget package -apt remove wget # Removes the wget package -apt upgrade # Upgrades all upgradable packages -apt clean # Clears out the local repository of downloaded package files - -dpkg -i|--install package_name.deb # Install deb file -dpkg -P package_name.deb # Remove a deb file installion (including configuration files) -rpm -i|--install package_name.rpm # Install a rpm file installion -rpm -e package_name.rpm # Remove rpm file installion (including dependencies) -``` - -### Install package source code - -```bash -tar zxvf sourcecode.tar.gz -cd sourcecode -./configure -make -make install -``` -[⬆ ʀᴇᴛᴜʀɴ ᴛᴏ ᴄᴏɴᴛᴇɴᴛꜱ](#contents) - -## Disk Usage - -```bash -df # List disks, size, used and available space -df -h|--human-readable # List disks, size, used and available space in a human readable format - -du # List current directory, subdirectories and file sizes -du /foo/bar # List specified directory, subdirectories and file sizes -du -h|--human-readable # List current directory, subdirectories and file sizes in a human readable format -du -d|--max-depth # List current directory, subdirectories and file sizes within the max depth -du -d 0 # List current directory size -``` -[⬆ ʀᴇᴛᴜʀɴ ᴛᴏ ᴄᴏɴᴛᴇɴᴛꜱ](#contents) - -## Memory Usage - -```bash -free # Show memory usage -free -h|--human # Show human readable memory usage -free -h|--human --si # Show human readable memory usage in power of 1000 instead of 1024 -free -s|--seconds 5 # Show memory usage and update continuously every five seconds -``` -[⬆ ʀᴇᴛᴜʀɴ ᴛᴏ ᴄᴏɴᴛᴇɴᴛꜱ](#contents) - -## Shutdown and Reboot - -```bash -shutdown # Shutdown in 1 minute -shutdown now # Immediately shut down -shutdown +5 # Shutdown in 5 minutes - -shutdown -r|--reboot # Reboot in 1 minute -shutdown -r|--reboot now # Immediately reboot -shutdown -r|--reboot +5 # Reboot in 5 minutes -shutdown -c # Cancel a shutdown or reboot - -reboot # Reboot now -reboot -f # Force a reboot -``` -[⬆ ʀᴇᴛᴜʀɴ ᴛᴏ ᴄᴏɴᴛᴇɴᴛꜱ](#contents) - -## Identifying Processes - -```bash -top # List all processes interactively -htop # List all processes interactively -ps ax # List all processes -pidof foo # Return the PID of all foo processes - -CTRL+Z # Suspend a process running in the foreground -bg # Resume a suspended process and run in the background -fg # Bring the last background process to the foreground -fg 1 # Bring the background process with the PID to the foreground - -sleep 30 & # Sleep for 30 seconds and move the process into the background -jobs # List all background jobs -jobs -p # List all background jobs with their PID - -lsof # List all open files and the process using them -lsof -itcp:4000 # Return the process listening on port 4000 -``` -[⬆ ʀᴇᴛᴜʀɴ ᴛᴏ ᴄᴏɴᴛᴇɴᴛꜱ](#contents) - -## Process Priority - -Process priorities go from -20 (highest) to 19 (lowest). - -```bash -nice -n -20 foo # Change process priority by name -renice 20 PID # Change process priority by PID -ps -o ni PID # Return the process priority of PID -``` -[⬆ ʀᴇᴛᴜʀɴ ᴛᴏ ᴄᴏɴᴛᴇɴᴛꜱ](#contents) - -## Killing Processes - -```bash -CTRL+C # Kill a process running in the foreground -kill PID # Shut down process by PID gracefully. Sends TERM signal. -kill -9 PID # Force shut down of process by PID. Sends SIGKILL signal. -pkill foo # Shut down process by name gracefully. Sends TERM signal. -pkill -9 foo # force shut down process by name. Sends SIGKILL signal. -killall foo # Kill all process with the specified name gracefully. -``` -[⬆ ʀᴇᴛᴜʀɴ ᴛᴏ ᴄᴏɴᴛᴇɴᴛꜱ](#contents) - -## Date & Time - -```bash -date # Print the date and time -date --iso-8601 # Print the ISO8601 date -date --iso-8601=ns # Print the ISO8601 date and time - -date -s "02 DEC 2020 12:02:02" # Manually change date and time -dpkg-reconfigure tzdata # Change date/timezone - -uptime # Print how long the system has been running -time tree # Print amount of time to tree takes to execute -``` -[⬆ ʀᴇᴛᴜʀɴ ᴛᴏ ᴄᴏɴᴛᴇɴᴛꜱ](#contents) - -## Scheduled Tasks - -```pre - * * * * * -Minute, Hour, Day of month, Month, Day of the week -``` - -```bash -crontab -l # List cron tab -crontab -e # Edit cron tab in a file editor -crontab /path/crontab # Load cron tab from a file -crontab -l > /path/crontab # Save cron tab to a file - -* * * * * foo # Run foo every minute -*/15 * * * * foo # Run foo every 15 minutes -0 * * * * foo # Run foo every hour -15 6 * * * foo # Run foo daily at 6:15 AM -44 4 * * 5 foo # Run foo every Friday at 4:44 AM -0 0 1 * * foo # Run foo at midnight on the first of the month -0 0 1 1 * foo # Run foo at midnight on the first of the year - -at -l # List scheduled tasks -at -c 1 # Show task with ID 1 -at -r 1 # Remove task with ID 1 -at now + 2 minutes # Create a task in a file editor to execute in 2 minutes -at 12:34 PM next month # Create a task in a file editor to execute at 12:34 PM next month -at tomorrow # Create a task in a file editor to execute tomorrow -``` -[⬆ ʀᴇᴛᴜʀɴ ᴛᴏ ᴄᴏɴᴛᴇɴᴛꜱ](#contents) - -## User Management - -```bash -sudo su # Switch to root user -sudo foo # Execute commands(has permission denied) as the root user -sudo nano /foo/foo.txt # Open directories and files(is not writable) as the root user -su username # Switch to a different user - -passwd # To change the password of a user -adduser username # To add a new user -userdel username # To remove user -userdel -r|--remove username # To remove user with home directory and mail spool -usermod -a|--append -G|--groups GROUPNAME USERNAME # To add a user to a group -deluser USER GROUPNAME # To remove a user from a group - -last # Display information of all the users logged in -last username # Display information of a particular user -w # Display who is online -``` -[⬆ ʀᴇᴛᴜʀɴ ᴛᴏ ᴄᴏɴᴛᴇɴᴛꜱ](#contents) - -## HTTP Requests - -```bash -curl https://example.com # Return response body -curl -i|--include https://example.com # Include status code and HTTP headers -curl -L|--location https://example.com # Follow redirects -curl -O|--remote-name foo.txt https://example.com # Output to a text file -curl -H|--header "User-Agent: Foo" https://example.com # Add a HTTP header -curl -X|--request POST -H "Content-Type: application/json" -d|--data '{"foo":"bar"}' https://example.com # POST JSON -curl -X POST -H --data-urlencode foo="bar" http://example.com # POST URL Form Encoded - -wget https://example.com/file.txt # Download a file to the current directory -wget -O|--output-document foo.txt https://example.com/file.txt # Output to a file with the specified name -``` -[⬆ ʀᴇᴛᴜʀɴ ᴛᴏ ᴄᴏɴᴛᴇɴᴛꜱ](#contents) - -## Network Troubleshooting - -```bash -ifconfig # Display all network card and interface information -ifconfig -a # Display information of all network cards (including those that are not started at boot) -ifconfig eth0 # Display specific device information -ifconfig eth0 up # Turn on the network card -ifconfig eth0 down # Turn off the network card -ifconfig eth0 192.168.120.56 # Configure IP address for network card - -curl ifconfig.me # Obtain external IP address - -ping example.com # Send multiple ping requests using the ICMP protocol -ping -c 10 -i 5 example.com # Make 10 attempts, 5 seconds apart - -ip addr # List IP addresses on the system -ip route show # Show IP addresses to router - -netstat -i|--interfaces # List all network interfaces and in/out usage -netstat -l|--listening # List all open ports - -traceroute example.com # List all servers the network traffic goes through - -mtr -w|--report-wide example.com # Continually list all servers the network traffic goes through -mtr -r|--report -w|--report-wide -c|--report-cycles 100 example.com # Output a report that lists network traffic 100 times - -nmap 0.0.0.0 # Scan for the 1000 most common open ports on localhost -nmap 0.0.0.0 -p1-65535 # Scan for open ports on localhost between 1 and 65535 -nmap 192.168.4.3 # Scan for the 1000 most common open ports on a remote IP address -nmap -sP 192.168.1.1/24 # Discover all machines on the network by ping'ing them -``` -[⬆ ʀᴇᴛᴜʀɴ ᴛᴏ ᴄᴏɴᴛᴇɴᴛꜱ](#contents) - -## DNS - -```bash -dig example.com # Show query information of domain A records -dig -4 example.com # Show IPv4 A records -dig -6 example.com # Show IPv6 AAA records -dig example.com @nameserver # Show query of a specific nameserver -dig example.com -p 123 # Show query of a specific port number - -cat /etc/resolv.conf # Nameservers file -cat /etc/systemd/resolved.conf # DNS resolver config file -``` -[⬆ ʀᴇᴛᴜʀɴ ᴛᴏ ᴄᴏɴᴛᴇɴᴛꜱ](#contents) - -## Hardware - -```bash -lsusb # List USB devices -lspci # List PCI hardware -lshw # List all hardware -``` -[⬆ ʀᴇᴛᴜʀɴ ᴛᴏ ᴄᴏɴᴛᴇɴᴛꜱ](#contents) - -## System Information - -```bash -uname -s # Print kernel name -uname -r # Print kernel release -uname -m # Print Architecture -uname -o # Print Operating System -uname -a # Print all Systen info - -lsb_release -a # Print distribution-specific information -dpkg --print-architecture # Print-architecture by name - -cat /proc/cpuinfo # Show cpu info -cat /proc/meminfo # Show memory info - -``` -[⬆ ʀᴇᴛᴜʀɴ ᴛᴏ ᴄᴏɴᴛᴇɴᴛꜱ](#contents) - -## Terminal Multiplexers - -Start multiple terminal sessions. Active sessions persist reboots. `tmux` is more modern than `screen`. - -```bash -tmux # Start a new session (CTRL-b + d to detach) -tmux ls # List all sessions -tmux attach -t 0 # Reattach to a session - -screen # Start a new session (CTRL-a + d to detach) -screen -S foo # Start a new named session -screen -ls # List all sessions -screen -R 31166 # Reattach to a session - -exit # Exit a session -reset # Reset the terminal(when binary and the terminal state is messed up) -``` -[⬆ ʀᴇᴛᴜʀɴ ᴛᴏ ᴄᴏɴᴛᴇɴᴛꜱ](#contents) - -## Secure Shell Protocol (SSH) - -```bash -ssh hostname # Connect to hostname using your current user name over the default SSH port 22 -ssh -i foo.pem hostname # Connect to hostname using the identity file -ssh user@hostname # Connect to hostname using the user over the default SSH port 22 -ssh user@hostname -p 8765 # Connect to hostname using the user over a custom port -ssh ssh://user@hostname:8765 # Connect to hostname using the user over a custom port -``` - -Set default user and port in `~/.ssh/config`, so you can just enter the name next time: - -```bash -$ cat ~/.ssh/config -Host name - User foo - Hostname 127.0.0.1 - Port 8765 -$ ssh name -``` -[⬆ ʀᴇᴛᴜʀɴ ᴛᴏ ᴄᴏɴᴛᴇɴᴛꜱ](#contents) - -## Secure Copy - -```bash -scp foo.txt ubuntu@hostname:/home/ubuntu # Copy foo.txt into the specified remote directory -scp ubuntu@hostname:/home/ubuntu/foo.txt /C:\Users\Admin # Copy foo.txt from the specified remote directory -``` -[⬆ ʀᴇᴛᴜʀɴ ᴛᴏ ᴄᴏɴᴛᴇɴᴛꜱ](#contents) - -## Bash Profile - -- bash - `.bashrc` -- zsh - `.zshrc` - -```bash -# Always run ls after cd -function cd { - builtin cd "$@" && ls -} - -# Prompt user before overwriting any files -alias cp='cp --interactive' -alias mv='mv --interactive' -alias rm='rm --interactive' - -# Always show disk usage in a human readable format -alias df='df -h' -alias du='du -h' -``` -[⬆ ʀᴇᴛᴜʀɴ ᴛᴏ ᴄᴏɴᴛᴇɴᴛꜱ](#contents) - -## Bash Script - -### Variables - -```bash -#!/bin/bash - -foo=123 # Initialize variable foo with 123 -declare -i foo=123 # Initialize an integer foo with 123 -declare -r foo=123 # Initialize readonly variable foo with 123 -echo $foo # Print variable foo -echo ${foo}_'bar' # Print variable foo followed by _bar -echo ${foo:-'default'} # Print variable foo if it exists otherwise print default - -export foo # Make foo available to child processes -unset foo # Make foo unavailable to child processes and current session -``` - -### Environment Variables - -```bash -#!/bin/bash - -set # List all environment variables -echo $PATH # Print PATH environment variable -export FOO=Bar # Set an environment variable -``` - -### Functions - -```bash -#!/bin/bash - -greet() { - local world="World" - echo "$1 $world" - return "$1 $world" -} -greet "Hello" -greeting=$(greet "Hello") -``` - -### Exit Codes - -```bash -#!/bin/bash - -exit 0 # Exit the script successfully -exit 1 # Exit the script unsuccessfully -echo $? # Print the last exit code -``` - -### Conditional Statements - -#### Boolean Operators - -- `$foo` - Is true -- `!$foo` - Is false - -#### Numeric Operators - -- `-eq` - Equals -- `-ne` - Not equals -- `-gt` - Greater than -- `-ge` - Greater than or equal to -- `-lt` - Less than -- `-le` - Less than or equal to -- `-e` foo.txt - Check file exists -- `-z` foo - Check if variable exists - -#### String Operators - -- `=` - Equals -- `==` - Equals -- `-z` - Is null -- `-n` - Is not null -- `<` - Is less than in ASCII alphabetical order -- `>` - Is greater than in ASCII alphabetical order - -#### If Statements - -```bash -#!/bin/bash - -[[ -if [[$foo = 'bar']]; then - echo 'one' -elif [[$foo = 'bar']] || [[$foo = 'baz']]; then - echo 'two' -elif [[$foo = 'ban']] && [[$USER = 'bat']]; then - echo 'three' -else - echo 'four' -fi -]] -``` - -#### Inline If Statements - -```bash -#!/bin/bash - -[[ $USER = 'rehan' ]] && echo 'yes' || echo 'no' -``` - -#### While Loops - -```bash -#!/bin/bash - -[ -declare -i counter -counter=10 -while [$counter -gt 2]; do - echo The counter is $counter - counter=counter-1 -done -] -``` - -#### For Loops - -```bash -#!/bin/bash - -for i in {0..10..2} - do - echo "Index: $i" - done - -for filename in file1 file2 file3 - do - echo "Content: " >> $filename - done - -for filename in *; - do - echo "Content: " >> $filename - done -``` - -#### Case Statements - -```bash -#!/bin/bash - -echo "What's the weather like tomorrow?" -read weather - -case $weather in - sunny | warm ) echo "Nice weather: " $weather - ;; - cloudy | cool ) echo "Not bad weather: " $weather - ;; - rainy | cold ) echo "Terrible weather: " $weather - ;; - * ) echo "Don't understand" - ;; -esac -``` - -

-Inspired by RehanSaeed/Bash-Cheat-Sheet

- -[⬆ ʀᴇᴛᴜʀɴ ᴛᴏ ᴄᴏɴᴛᴇɴᴛꜱ](#contents) - -

-
- -
Special characters Open Book -

- -> **Note** 💡
-> This symbol "└─>" represents an alternative meaning of some characters. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Char.Description
~Home directory [tilde]. The path to a user's home directory location.
-Last directory [hyphen]. Go to the previously chosen directory.
└─>Option flag for a command or filter.
└─>Arithmetic operator. Minus of arithmetic operations.
/Root directory [forward slash]. The path to root directory location.
└─>Filename path separator.
\Escape [backslash]. A quoting mechanism for single characters. It preserves the literal value of the next character that follows, with the exception of newline.
└─>Arithmetic operator. Divider of arithmetic operations.
|Pipe. This is a method of chaining commands together. Connects the output (stdout) of command1 to the input (stdin) of command2. Each command reads the previous command’s output.
|&This operator connects the output (stdout) and error (stderr) of command1 to the input (stdin) of command2.
||The OR operator is used to chain commands. It will execute the first command then stop if successful, if not, it will proceed pass failed commands until one is successful and stop.
&&The AND operator is used to chain commands. It will execute commands only if the first command is successful and proceed until one fails.
;Command separator [semicolon]. Used to separate multiple commands and output all successful and failed ones.
&Run job in background [and]. A command followed by an & will run in the background.
>, >>, <Redirect a command's standard output (stdout) or input (stdin) into a file.
&>, >&Redirects a command's both standard output (stdout) and error (stderr) into a file.
<&-Close standard input (stdin) to prevent showing from a file.
>&-Close standard output (stdout) to prevent showing from a file.
>|Force redirection (even if the noclobber option is set). This will forcibly overwrite an existing file. -
"Partial quoting [double quotes]. Protects the text inside them from being split into multiple words or arguments, yet allow substitutions to occur, meaning most other special characters is usually prevented.
.Source command [period]. To evaluate commands in the current execution context. This is a bash builtin.
└─>"As a component of a filename. When working with filenames, a leading dot is the prefix of a "hidden" file, a file that an ls will not normally show.
└─>Character match. When matching characters, as part of a regular expression, a "dot" matches a single character.
'Full quoting [single quotes]. Protects the text inside them so that it has a literal meaning. This is a stronger form of quoting than double quotes.
`Command substitution [backquotes]. Assign the output of a shell command to a variable.
#Comment [number sign]. Lines in files beginning with a # (with the exception of #!) are comments and will not be executed.
!Reverse (or negate) [exclamation]. The ! operator inverts the exit status of the command to which it is applied. It also inverts the meaning of a test operator.
*Wild card [asterisk]. The * character serves as a "wild card" for filename expansion in globbing. By itself, it matches every filename in a given directory. -
└─>Arithmetic operator. Multiplier of arithmetic operations.
?Wild card [question mark]. The ? character serves as a single-character "wild card" for filename expansion in globbing, as well as representing one character in an extended regular expression.
└─>Test operator. Within certain expressions, the ? indicates a test for a condition.
{ }Inline group [curly brackets]. Commands inside the curly braces are treated as if they were one command.
└─>Placeholder for output text.
( )Subshell group [parentheses]. Commands within are executed in a subshell (a new process) Used much like a sandbox, if a command causes side effects (like changing variables), it will have no effect on the current shell.
[ ]Test expression [brackets]. It is part of the shell builtin test.
└─>Array element. Brackets set off the numbering of each element.
└─>Range of characters. As part of a regular expression, brackets delineate a range of characters to match.
[[ ]]Test/Evaluate [double brackets] a condition expression to determine whether true or false. It is more flexible than the single-bracket [ ] test. -
(( ))Arithmetic expression [double parentheses]. Characters such as +, -, *, and / are mathematical operators used for calculations.
~+Current working directory.
~-Previous working directory.
:Null command [colon]. This is the shell equivalent of a "NOP" (no op, a do-nothing operation). It may be considered a synonym for the shell builtin true.
;;Terminator [double semicolon]. Only used in case constructs to indicate the end of an alternative.
" "Whitespace. This is a tab, newline, vertical tab, form feed, carriage return, or space. Bash uses whitespace to determine where words begin and end.
,, ,Lowercase conversion in parameter substitution.
^, ^^Uppercase conversion in parameter substitution.
$Variable substitution. A $ prefixing a variable name indicates the value the variable holds
└─>End-of-line. In a regular expression, a "$" addresses the end of a line of text.
$*All the arguments are seen as a single word.
!!The previous command.
!$The last argument to the previous command.
!*All the arguments from the previous command.
$?The exit status of the last command executed.
$#The number of arguments supplied to a script.
$$The process number of the current shell. For shell scripts, this is the process ID under which they are executing.
$!The process number of the last background command.
$_Special variable set to final argument of previous command executed.
$-Expands to the current option flags as specified upon invocation, by the set builtin command, or those set by the shell itself (such as the -i option). -
$0Used to reference the name of the current shell or current shell script.
$nThese variables correspond to the arguments with which a script was invoked. Here n is a positive decimal number corresponding to the position of an argument (the first argument is $1, the second argument is $2, and so on).
- - [⬆ ʀᴇᴛᴜʀɴ ᴛᴏ ᴛᴏᴩ](#special-characters-) - -

-
- -
Keyboard controls Keyboard -

- -| Key | Function | -| :--: | :-- | -| Ctrl+B | Moves cursor backward one character position | -| Ctrl+F | Moves cursor forward one character position | -| Alt+F | Moves cursor one word forward in line | -| Alt+B | Moves cursor one word backwards in line | -| Ctrl+A | Moves cursor to beginning of text in line | -| Ctrl+E | Moves cursor to end of text in line | -| Ctrl+D | Erase character forward from cursor left to right | -| Ctrl+H | Erase character backward from cursor right to left | -| Alt+D | Erase the next word from cursor left to right | -| Ctrl+W | Erase backwards to first non-alphanumeric character or empty space | -| Ctrl+U | Erase a line of input from cursor right to left | -| Ctrl+K | Erase a line of input from cursor left to right | -| Ctrl+P | Fetch previous command from history list | -| Ctrl+N | Fetch next command from history list | -| Ctrl+/ | Undo changes in command-line | -| Alt+R | Reverts any changes to a previously executed command that's being edited | -| Alt+. | Fetch and paste the last word at end of a command from previous commands | -| Ctrl+T | Reverses the position of the character the cursor is on with the previous character | -| Alt+T | Reverses the position of the word the cursor is in with the previous word | -| Alt+U | Capitalizes every character from cursor left to right to the end of one word | -| Alt+L | UnCapitalizes every character from cursor left to right to the end of one word | -| Ctrl+R | Reverse search commands from history list | -| Ctrl+Y | Causes the process to be stopped| -| Ctrl+Z | Pauses a foreground job | -| Ctrl+C | Break/Terminate a foreground job | -| Ctrl+M | Clear the current line | -| Ctrl+O | Accept the current line for execution and fetch the next command | -| Ctrl+L | Clear screen contents (command-line needs to be empty) | -| Ctrl+S | Suspend | -| Ctrl+Q | Resume | -| Ctrl+D | Log out from a shell (similar to exit) | - Ctrl+X(twice)| The cursor jumps back and forth between the current position to the beginning of the line | - -### Nano - -| Key | Function | -| :--: | :-- | -| Ctrl+Y | Scrolls page down | -| Ctrl+V | Scrolls page up| -| Alt+\ | Go to beginning of file | -| Alt+/ | Go to end of file | -| Ctrl+H | Delete character before cursor | -| Ctrl+D | Erase character under cursor | -| Alt+Backspace | Erase word to the left | -| Ctrl+Del |Erase word to the right | -| Alt+Del | Erase current line | -| Alt+^ | Copy selected text | -| Ctrl+U | To paste the text from the cut buffer (similar to clipboard) into the selected line. | -| Ctrl+K | It cuts the entire selected line to the cut buffer. | -| Alt+A | To select text. You can combine this command with CTRL + K to cut a specific part of the text to the cut buffer. | -| Alt+U | Undo last action | -| Alt+E | Redo last undone action | -| Ctrl+Q | Start backward search. Press Ctrl+Q to search for the same phrase again | -| Ctrl+W | Start forward search. Press ALT+W to search for the same phrase again | -| Ctrl+\ | Replaces string or a regular expression | -| Alt+3 | Comment/uncomment line/region | -| Ctrl+R | Opens a file and inserts it at the current cursor position | -| Ctrl+O | Write changes to a file ("Save as") | -| Ctrl+S | Save current file | -| Ctrl+X | To exit Nano text editor. It prompts a save request if you made any changes to the file | -| Ctrl+G | A Help window will pop out and show you all the available commands | - -

-
- ---- - -
Cheat Sheet for quick references of commands and codes - -[cheat.sh](https://github.com/chubin/cheat.sh)
-![image](https://user-images.githubusercontent.com/18756975/200065767-13a6249f-2188-4206-8073-1714be57c408.png)
-
-
Cheat sheets sources -

- -|Cheat sheets |Repository |C/U* |Stars |Creation Date| -|-----------------------|------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------|-------------| -|UNIX/Linux, programming|[cheat.sheets](https://github.com/chubin/cheat.sheets) |![](https://img.shields.io/github/contributors-anon/chubin/cheat.sheets?label=%F0%9F%91%A5&labelColor=white) |![](https://img.shields.io/github/stars/chubin/cheat.sheets?label=%E2%AD%90&labelColor=white) |May 1, 2017 | -|UNIX/Linux commands |[tldr-pages/tldr](https://github.com/tldr-pages/tldr) |![](https://img.shields.io/github/contributors-anon/tldr-pages/tldr?label=%F0%9F%91%A5&labelColor=white) |![](https://img.shields.io/github/stars/tldr-pages/tldr?label=%E2%AD%90&labelColor=white) |Dec 8, 2013 | -|UNIX/Linux commands |[chrisallenlane/cheat](https://github.com/chrisallenlane/cheat) |![](https://img.shields.io/github/contributors-anon/chrisallenlane/cheat?label=%F0%9F%91%A5&labelColor=white) |![](https://img.shields.io/github/stars/chrisallenlane/cheat?label=%E2%AD%90&labelColor=white) |Jul 28, 2013 | -|Programming languages |[adambard/learnxinyminutes-docs](https://github.com/adambard/learnxinyminutes-docs) |![](https://img.shields.io/github/contributors-anon/adambard/learnxinyminutes-docs?label=%F0%9F%91%A5&labelColor=white)|![](https://img.shields.io/github/stars/adambard/learnxinyminutes-docs?label=%E2%AD%90&labelColor=white)|Jun 23, 2013 | -|Go |[a8m/go-lang-cheat-sheet](https://github.com/a8m/go-lang-cheat-sheet) |![](https://img.shields.io/github/contributors-anon/a8m/go-lang-cheat-sheet?label=%F0%9F%91%A5&labelColor=white) |![](https://img.shields.io/github/stars/a8m/go-lang-cheat-sheet?label=%E2%AD%90&labelColor=white) |Feb 9, 2014 | -|Perl |[pkrumnis/perl1line.txt](https://github.com/pkrumins/perl1line.txt) |![](https://img.shields.io/github/contributors-anon/pkrumins/perl1line.txt?label=%F0%9F%91%A5&labelColor=white) |![](https://img.shields.io/github/stars/pkrumins/perl1line.txt?label=%E2%AD%90&labelColor=white) |Nov 4, 2011 | -|Programming languages |[StackOverflow](https://stackoverflow.com) |[14M](https://stackexchange.com/leagues/1/alltime/stackoverflow)|N/A - - -

-
-
- -### Usage (Online) -_**Terminal**_ : -```bash -curl cht.sh/keyword -# or -curl cheat.sh/keyword -``` -_**Browser**_ : - -> [https://cht.sh/](https://cht.sh/)keyword
-> or
-> [https://cheat.sh/](https://cheat.sh/)keyword - -# - - ### Offline usage install cheat script manually
-_**Install globally(all users)**_ : -```bash -curl -s https://cht.sh/:cht.sh | sudo tee /usr/local/bin/cht.sh && sudo chmod +x /usr/local/bin/cht.sh -``` -_**Run**_ : -```bash -cht.sh keyword -``` ->**Note** - More info on usage : - -> https://cht.sh/:help - -

-
- ---- - -
More bash resources - -| | | -| :--: | :--: | -| [introduction-to-bash-scripting](https://github.com/bobbyiliev/introduction-to-bash-scripting) | Free Introduction to Bash Scripting eBook| -| [shell-scripting-tutorial](https://github.com/techarkit/shell-scripting-tutorial) | A complete begineers guide to learn shell scripting from scratch which includes Videos, Practice scenarios and project idea. | -| [100-shell-script-examples](https://github.com/epety/100-shell-script-examples) | Collection of shell scripts found on the internet | -| [simple-bash-scripts](https://github.com/ruanyf/simple-bash-scripts) | A collection of simple Bash scripts | -| [shell-examples](https://github.com/qjcg/shell-examples) | Little Bash shell scripting examples | -| [bash-utils](https://github.com/pirate/bash-utils)| A collection of hand-crafted bash scripts for various common tasks | -| [Bash-Snippets](https://github.com/alexanderepstein/Bash-Snippets) | A collection of small bash scripts for heavy terminal users | -| [awesome-bash](https://github.com/awesome-lists/awesome-bash) | A curated list of delightful Bash scripts and resources | -| [awesome-shell](https://github.com/uhub/awesome-shell) | A curated list of awesome Shell frameworks, libraries and software | -| [awesome-cli-apps](https://github.com/agarrharr/awesome-cli-apps) | A curated list of command line apps | -| [cli-apps](https://github.com/toolleeo/cli-apps) | Awesome Curated list of (mainly) CLI/TUI applications with source data organized into CSV files | -| [awesome-cli](https://github.com/Kikobeats/awesome-cli) | A curated list of awesome resources for building immersive CLI experiences | -| [awesome-cli](https://github.com/umutphp/awesome-cli) | A simple command line tool to give you a fancy command line interface to dive into Awesome lists | -| [terminals-are-sexy](https://github.com/k4m4/terminals-are-sexy) | A curated list of Terminal frameworks, plugins & resources for CLI lovers | -| [awesome-ttygames](https://github.com/ligurio/awesome-ttygames) | Unix ASCII games | -| [shell_gpt](https://github.com/TheR1D/shell_gpt) | A command-line productivity tool powered by AI large language models like GPT-4, will help you accomplish your tasks faster and more efficiently. | - - -

-
- ---- diff --git a/alternatives for history|find|cd.md b/alternatives for history|find|cd.md deleted file mode 100644 index 43dfd1e..0000000 --- a/alternatives for history|find|cd.md +++ /dev/null @@ -1,215 +0,0 @@ -The most commonly used commands when navigating are `history`, `find`, `cd`. Here are some examples of simple alternative tools that does a better job. - -
Easily view, navigate, search history commands - -[htsr](https://github.com/dvorka/hstr)
-![hts](https://user-images.githubusercontent.com/18756975/201403803-7f899124-3412-443c-9b6d-e60b8b2ca889.png)
-_**Install**_ : -```bash -sudo apt install hstr -y && hstr --show-configuration >> ~/.bashrc -``` -_Restart terminal_ -> **Note** - Other installation info - [github.com/dvorka/hstr/blob/master/INSTALLATION.md](https://github.com/dvorka/hstr/blob/master/INSTALLATION.md#installation) - -**_Usage_** : -```bash -hstr keyword -``` -Interactive searching🔎 : -`Ctrl+R` - ->**Note** - More info on usage : - -> man hstr -# - -

-
- - -
A simple and userfriendly way to find files - -

-fd and fzf
- - - -_**Install**_ : -```bash -sudo apt install fd-find -y && sudo apt install fzf -y -``` -_**Add binary link**_(set correct bin directory location if error) : -```bash -ln -s $(which fdfind) ~/.local/bin/fd -``` -_Restart terminal_ -> **Note** - Other installation info :
-[github.com/sharkdp/fd#installation](https://github.com/sharkdp/fd#installation)
-[github.com/junegunn/fzf#installation)](https://github.com/junegunn/fzf#installation) - -_**Usage**_ : - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CommandDescription
fd fooFind in current directory, the string pattern name "foo", in parent|sub directories and files.
fd foo /FOO2Find in "FOO2" directory, the string pattern name "foo", in parent|sub directories and files.
fd -g|--glob foo /FOO2Find in "FOO2" directory, the glob pattern name matching "foo", in parent|sub directories and files.
fd /foo -p|--path /FOO2Find in "FOO2" directory and view the files and directory paths and its contents that is or starts with the string pattern name "foo".
fd foo/ -p|--path /FOO2Find in "FOO2" directory and view the directory paths and its contents that is or ends with the string pattern name "foo".
fd -t|--type -d fooFind for directory type only.
fd -t|--type -f fooFind for file type only.
fd -t|--type d -t|--type e fooFind for empty directories only.
fd -a|--absolute-path fooFind in current directory showing the full path, the string name "foo", in parent|sub directories and files.
fd -e|--extension txtFind for a particular file extension.
fd -H|--hidden fooFind for hidden and ignored files.
- -fzf interactive searching🔎 : -`Ctrl+T` - ->**Note** - More info on usage : - -> man fd - -> man fzf -# - -

-
- -
Smarter directory navigating - -[commacd](https://github.com/shyiko/commacd) - -A faster way to move around - -_**Install**_ : -```bash -curl -sSL https://github.com/shyiko/commacd/raw/v1.0.0/commacd.sh -o ~/.commacd.sh && \ - echo "source ~/.commacd.sh" >> ~/.bashrc -``` - -commacd exports three commands: forward(`,`) │ backward(`,,`) │ backward+forward(`,,,`) - -_**Usage**_ : -| Description | commacd | command | -| :--:| :--: | :--: | -| Enter directories using| , des | | -| abbreviations. | └─> | cd Desktop | - -| Description | commacd | command | -| :--:| :--: | :--: | -| Move through multiple directories| , u/l/ce | | -| using abbreviations. | └─> | cd /usr/local/Cellar | - -| Description | commacd | options | -| :--:| :--: | :--: | -| Choose directories with names | , d | | -| starting with same letter. | 0 | Desktop | -| (= multiple choices) | 1 | Documents | -| 0, 1 or 2 | 2 | Downloads | - -| Description | commacd | command | -| :--:| :--: | :--: | -| Given two directories jdk7 and jdk8 | , ~/d/j*8 | | -| on the Desktop, cd into jdk8 without hitting | └─> | cd ~/Desktop/jdk8 | -| interactive mode (the one shown above). | | | - -| Description | commacd | -| :--:| :--: | -| Go back previous directory | ,, .. | - -Tab = Autocomplete - ->**Note** - More info on usage : - -> [shyiko.com/commacd](https://shyiko.com/2014/10/10/commacd/) - -# - -[zoxide](https://github.com/ajeetdsouza/zoxide) - -It remembers which directories you use most frequently, so you can "jump" to them in just a few keystrokes. - - - -_**Install**_ : -```bash -sudo apt install zoxide -``` -Open ~/.bashrc and add -``` -eval "$(zoxide init bash)" -``` -_Restart terminal_ - -> **Note** - Other installation info - [github.com/ajeetdsouza/zoxide#installation](https://github.com/ajeetdsouza/zoxide#installation) - -_**Usage**_ : - ```bash -z foo # cd into highest ranked directory matching foo -z foo bar # cd into highest ranked directory matching foo and bar -z foo / # cd into a subdirectory starting with foo - -z ~/foo # z also works like a regular cd command -z foo/ # cd into relative path -z .. # cd one level up -z - # cd into previous directory - -zi foo # cd with interactive selection (using fzf) - -z foo # show interactive completions (zoxide v0.8.0+, bash 4.4+/fish/zsh only) -``` - ->**Note** - More info on usage : - -> [Algorithm matching](https://github.com/ajeetdsouza/zoxide/wiki/Algorithm#matching) - -# - -

-
- -
- -> [!NOTE] -> There are more alternative tools available out there that may better fit your needs.
-> Check out [Modern Unix](https://github.com/ibraheemdev/modern-unix) - A collection of modern/faster/saner alternatives to common unix commands. diff --git a/shell.txt b/shell.txt new file mode 100644 index 0000000..03ff098 --- /dev/null +++ b/shell.txt @@ -0,0 +1,2 @@ +#This is amazing Linux GitHub Profile +- Rajdwip Says that that community is amazing