Differences between revisions 30 and 31
Revision 30 as of 2019-08-19 21:27:22
Size: 7717
Editor: nodiscc
Comment: wording
Revision 31 as of 2019-08-19 21:48:08
Size: 8403
Editor: nodiscc
Comment: link to manpages, wording, shorten
Deletions are marked like this. Additions are marked like this.
Line 2: Line 2:

/* Add a link to the manpage for each command:[[DebianMan:example.1|example]]
/* (or wiki page if it exists)
Line 5: Line 9:
A shell accepts various kinds of commands: The page is about basic command-line operation of a GNU/Linux system.

A command-line [[Shell]] accepts various kinds of commands:
Line 13: Line 19:
The '''[[coreutils]]''' page lists basic command-line utilities you will probably want to know to use Debian or any GNU/Linux system. == coreutils ==
Line 15: Line 21:
This page is about commonly used shell commands. Each command links to its ManPages or wiki page. You can also use https://manpages.debian.org/ to browse and search for manpages. The [[GNU Core Utilities (coreutils)]] are the basic file, shell and text manipulation utilities of the GNU operating system. These are the core utilities which are expected to exist on every UNIX-like operating system.
Line 17: Line 23:
Each command links to its ManPages or wiki page.
Line 18: Line 25:
To get detailed information on how to use a program, read its ManPage. https://manpages.debian.org/ provides all Debian manpages.

Shell commands can be combined in a ShellScript.
Line 35: Line 45:
These commands are provided by various Debian packages.
Line 38: Line 46:

Line 45: Line 51:




-------------------

'''TODO: sort everything below, add manpage links'''


















































 * '''#:''' Comment / Remark.
 * '''. :''' See ''source''
 * '''[[dmesg]]:''' Output is from the kernel booting, showing the devices it has found and if it has been able to configure them at all (aside from userland configuration).
 * '''[[sudo]]:''' Execute a command as another user
 * '''cmp:''' Compare two files
 * '''comm:''' Compare two sorted files line by line
 * '''cp''' Copy one or more files to another location
 * '''crontab:''' Schedule a command to run at a later time
 * '''date:''' Display or change the date & time
 * '''dc:''' Desk Calculator
 * '''dd:''' Data Dump - Convert and copy a file
 * '''df:''' Display free disk space
 * '''diff:''' Display the differences between two files
 * '''dir:''' Briefly list directory contents
 * '''dircolors:''' Colour setup for ''ls''
 * '''dirname:''' Convert a full pathname to just a path
 * '''du:''' Estimate file space usage
 * '''eject:''' Eject CD-ROM
 * '''env:''' Display, set, or remove environment variables
 * '''exit:''' Exit the shell (or press Ctrl-D)
 * '''export:''' Set an environment variable
 * '''fdisk:''' Partition table manipulator for Linux
 * '''file{{{}}}:''' Tells what kind of files are those listed on command line
 * '''find:''' Search for files that meet a desired criteria
 * '''for:''' Expand words, and execute commands
 * '''format:''' Format disks or tapes
 * '''free:''' Display memory usage
 * '''fsck:''' Filesystem consistency check and repair.
 * '''ftp{{{}}}:''' Transfer/receive files from/to a remote host
 * '''groups:''' Print group names a user is in
 * '''gzip/gunzip:''' Compress or decompress named file(s)
 * '''head:''' Output the first part of file(s)
 * '''history:''' Command History
 * '''hostname:''' Print or set system name
 * '''id:''' Print user and group id's
 * '''if/then/else/elif/fi''' Conditionally perform a command
 * '''info:''' Help info
 * '''join:''' Joins lines on a common field
 * '''kill:''' Stops a process from running
 * '''killall:''' Stops matching process from running
 * '''less:''' Display output one screen at a time
 * '''ln:''' Make links between files
 * '''locate:''' Find files using an indexed list.
 * '''logname:''' Print current login name
 * '''logout:''' Exit a login shell
 * '''lpc:''' Line printer control program
 * '''lpr:''' Off line print
 * '''lprint:''' Print a file
 * '''lprintq:''' List the print queue
 * '''ls:''' List information about file(s)
 * '''man:''' Help manual
 * '''mkdir:''' Create new folder(s)
 * '''more:''' Display output one screen at a time
 * '''mount:''' Mount a file system
 * '''mv:''' Move or rename files or directories
 * '''nice:''' Set the priority of a command or job
 * '''passwd:''' Modify a user password
 * '''printf:''' Format and print data
 * '''ps:''' ''P''rocess ''S''tatus. Lists running process
 * '''pwd:''' ''P''rint ''W''orking ''D''irectory
 * '''rgrep:''' Recursive grep
 * '''rm:''' Remove file(s)
 * '''rmdir:''' Remove folder(s)
 * '''rsync:''' Remote file copy (Synchronize file trees) using its own protocol. It may be used over an ''ssh'' or ''rsh'' connection.
 * '''scp:''' Copy files between two machines over an ssh connection
 * '''sdiff:''' Merge two files interactively
 * '''sed:''' Stream Editor
 * '''select:''' Accept keyboard input
 * '''sftp:''' Secure file transfer (FTP over SSH)
 * '''shutdown:''' Shutdown or restart Linux
 * '''sleep:''' Delay for a specified time
 * '''sort:''' Sort text files
 * '''ssh{{{}}}:''' Secure Shell
 * '''su:''' Substitute user identity
 * '''sync:''' Synchronize data on disk with memory
 * '''tail:''' Output the last part of files
 * '''tar:''' Tape Archiver
 * '''time:''' Measure Program Resource Use
 * '''top:''' List processes running on the system
 * '''touch:''' Change file timestamps or create an empty file
 * '''tr:''' Translate, squeeze, and/or delete characters
 * '''traceroute:''' Trace Route to Host
 * '''true:''' Do nothing, successfully
 * '''umask:''' Users file creation mask
 * '''umount:''' Unmount a device
 * '''uname:''' Print system information
 * '''uniq:''' Uniquify files
 * '''until:''' Execute commands (until error)
 * '''useradd:''' Create new user account
 * '''usermod:''' Modify user account
 * '''users:''' List users currently logged in
 * '''vdir:''' Verbosely list directory contents (`ls -l -b`)
 * '''watch:''' Execute/display a program periodically
 * '''wc:''' Print byte, word and line counts
 * '''which:''' Locate a program file in the user's path.
 * '''who:''' Print all usernames currently logged in
 * '''whoami:''' Print the current user id and name (`id -un')

 * [[DebianMan:cmp.1|cmp]] - Compare two files
 * [[DebianMan:comm.1|comm]] - Compare two sorted files line by line
 * [[DebianMan:crontab.1|crontab]] - Schedule a command to run at a later time
 * [[DebianMan:date.1|date]] - Display or change the date & time
 * [[DebianMan:dc.1|dc]] - Desk Calculator
 * [[DebianMan:dd.1|dd]] - Data Dump - Convert and copy a file
 * [[DebianMan:df.1|df]] - Display free disk space
 * [[DebianMan:diff.1|diff]] - Display the differences between two files
 * [[DebianMan:dir.1|dir]] - Briefly list directory contents
 * [[DebianMan:dircolors.1|dircolors]] - Colour setup for ls
 * [[DebianMan:dirname.1|dirname]] - Convert a full pathname to just a path
 * [[DebianMan:du.1|du]] - Estimate file space usage
 * [[DebianMan:eject.1|eject]] - Eject CD-ROM
 * [[DebianMan:env.1|env]] - Display, set, or remove environment variables
 * [[DebianMan:exit.1|exit]] - Exit the shell (or press Ctrl-D)
 * [[DebianMan:export.1|export]] - Set an environment variable
 * [[DebianMan:fdisk.1|fdisk]] - Partition table manipulator for Linux
 * [[DebianMan:file.1|file]] - Tells what kind of files are those listed on command line
 * [[DebianMan:find.1|find]] - Search for files that meet a desired criteria
 * [[DebianMan:for.1|for]] - Expand words, and execute commands
 * [[DebianMan:format.1|format]] - Format disks or tapes
 * [[DebianMan:free.1|free]] - Display memory usage
 * [[DebianMan:fsck.1|fsck]] - Filesystem consistency check and repair.
 * [[DebianMan:ftp.1|ftp]] - Transfer/receive files from/to a remote host
 * [[DebianMan:groups.1|groups]] - Print group names a user is in
 * [[DebianMan:gzip/gunzip.1|gzip/gunzip]] - Compress or decompress named file(s)
 * [[DebianMan:head.1|head]] - Output the first part of file(s)
 * [[DebianMan:history.1|history]] - Command History
 * [[DebianMan:hostname.1|hostname]] - Print or set system name
 * [[DebianMan:id.1|id]] - Print user and group id's
 * [[DebianMan:info.1|info]] - Help info
 * [[DebianMan:join.1|join]] - Joins lines on a common field
 * [[DebianMan:kill.1|kill]] - Stops a process from running
 * [[DebianMan:killall.1|killall]] - Stops matching process from running
 * [[DebianMan:less.1|less]] - Display output one screen at a time
 * [[DebianMan:ln.1|ln]] - Make links between files
 * [[DebianMan:locate.1|locate]] - Find files using an indexed list.
 * [[DebianMan:logname.1|logname]] - Print current login name
 * [[DebianMan:logout.1|logout]] - Exit a login shell
 * [[DebianMan:lpc.1|lpc]] - Line printer control program
 * [[DebianMan:lpr.1|lpr]] - Off line print
 * [[DebianMan:lprint.1|lprint]] - Print a file
 * [[DebianMan:lprintq.1|lprintq]] - List the print queue
 * [[DebianMan:ls.1|ls]] - List information about file(s)
 * [[DebianMan:man.1|man]] - Help manual
 * [[DebianMan:mkdir.1|mkdir]] - Create new folder(s)
 * [[DebianMan:more.1|more]] - Display output one screen at a time
 * [[DebianMan:mount.1|mount]] - Mount a file system
 * [[DebianMan:mv.1|mv]] - Move or rename files or directories
 * [[DebianMan:nice.1|nice]] - Set the priority of a command or job
 * [[DebianMan:passwd.1|passwd]] - Modify a user password
 * [[DebianMan:printf.1|printf]] - Format and print data
 * [[DebianMan:ps.1|ps]] - Process Status. Lists running process
 * [[DebianMan:pwd.1|pwd]] - Print Working Directory
 * [[DebianMan:rgrep.1|rgrep]] - Recursive grep
 * [[DebianMan:rm.1|rm]] - Remove file(s)
 * [[DebianMan:rmdir.1|rmdir]] - Remove folder(s)
 * [[DebianMan:rsync.1|rsync]] - Remote file copy (Synchronize file trees) using its own protocol. It may be used over an ssh or rsh connection.
 * [[DebianMan:scp.1|scp]] - Copy files between two machines over an ssh connection
 * [[DebianMan:sdiff.1|sdiff]] - Merge two files interactively
 * [[DebianMan:sed.1|sed]] - Stream Editor
 * [[DebianMan:select.1|select]] - Accept keyboard input
 * [[DebianMan:sftp.1|sftp]] - Secure file transfer (FTP over SSH)
 * [[DebianMan:shutdown.1|shutdown]] - Shutdown or restart Linux
 * [[DebianMan:sleep.1|sleep]] - Delay for a specified time
 * [[DebianMan:sort.1|sort]] - Sort text files
 * [[DebianMan:ssh.1|ssh]] - Secure Shell
 * [[DebianMan:su.1|su]] - Substitute user identity
 * [[DebianMan:sync.1|sync]] - Synchronize data on disk with memory
 * [[DebianMan:tail.1|tail]] - Output the last part of files
 * [[DebianMan:tar.1|tar]] - Tape Archiver
 * [[DebianMan:time.1|time]] - Measure Program Resource Use
 * [[DebianMan:top.1|top]] - List processes running on the system
 * [[DebianMan:touch.1|touch]] - Change file timestamps or create an empty file
 * [[DebianMan:tr.1|tr]] - Translate, squeeze, and/or delete characters
 * [[DebianMan:traceroute.1|traceroute]] - Trace Route to Host
 * [[DebianMan:true.1|true]] - Do nothing, successfully
 * [[DebianMan:umask.1|umask]] - Users file creation mask
 * [[DebianMan:umount.1|umount]] - Unmount a device
 * [[DebianMan:uname.1|uname]] - Print system information
 * [[DebianMan:uniq.1|uniq]] - Uniquify files
 * [[DebianMan:until.1|until]] - Execute commands (until error)
 * [[DebianMan:useradd.1|useradd]] - Create new user account
 * [[DebianMan:usermod.1|usermod]] - Modify user account
 * [[DebianMan:users.1|users]] - List users currently logged in
 * [[DebianMan:vdir.1|vdir]] - Verbosely list directory contents (ls -l -b)
 * [[DebianMan:watch.1|watch]] - Execute/display a program periodically
 * [[DebianMan:wc.1|wc]] - Print byte, word and line counts
 * [[DebianMan:which.1|which]] - Locate a program file in the user's path.
 * [[DebianMan:who.1|who]] - Print all usernames currently logged in
 * [[DebianMan:whoami.1|whoami]] - Print the current user id and name (`id -un')
Line 208: Line 149:
 * '''Work in progress''' refactor this page
Line 210: Line 150:
 * '''TODO''' CategoryRedundant: merge with ShellToolTricks, PrincipalCommands [[coreutils]], [[Shell]], [[dash]], [[Sh]]  * '''TODO''' CategoryRedundant: merge other pages ShellToolTricks, PrincipalCommands [[coreutils]], [[Shell]], [[dash]], [[Sh]]

Translation(s): English - Français - Italiano - Русский

(!) ?Discussion


The page is about basic command-line operation of a GNU/Linux system.

A command-line Shell accepts various kinds of commands:

  • executable programs installed from Debian packages

  • manually installed executable programs
  • internal commands provided by the shell (built-ins)

  • aliases
  • ...

coreutils

The ?GNU Core Utilities (coreutils) are the basic file, shell and text manipulation utilities of the GNU operating system. These are the core utilities which are expected to exist on every UNIX-like operating system.

Each command links to its ?ManPages or wiki page.

To get detailed information on how to use a program, read its ManPage. https://manpages.debian.org/ provides all Debian manpages.

Shell commands can be combined in a ShellScript.

Shell builtins

  • A Shell builtin is a command or a function, called from a shell, that is executed directly in the shell itself, instead of an external executable program which the shell would load and execute.[1]

Here are some builtins provided by Bash, the default shell in Debian. See the bash manpage:

  • cd - change the shell working directory.

  • alias - create a command alias

  • echo - write text/arguments to the standard output

Compression

See Compression

Other commands

To know what package provides a specific program, use Search the contents of packages on https://packages.debian.org/

  • grep, egrep, fgrep, rgrep - print lines that match patterns

  • awk - pattern-directed scanning and processing language

  • xargs - build and execute command lines from standard input

  • clear - clear the terminal screen

  • cmp - Compare two files

  • comm - Compare two sorted files line by line

  • crontab - Schedule a command to run at a later time

  • date - Display or change the date & time

  • dc - Desk Calculator

  • dd - Data Dump - Convert and copy a file

  • df - Display free disk space

  • diff - Display the differences between two files

  • dir - Briefly list directory contents

  • dircolors - Colour setup for ls

  • dirname - Convert a full pathname to just a path

  • du - Estimate file space usage

  • eject - Eject CD-ROM

  • env - Display, set, or remove environment variables

  • exit - Exit the shell (or press Ctrl-D)

  • export - Set an environment variable

  • fdisk - Partition table manipulator for Linux

  • file - Tells what kind of files are those listed on command line

  • find - Search for files that meet a desired criteria

  • for - Expand words, and execute commands

  • format - Format disks or tapes

  • free - Display memory usage

  • fsck - Filesystem consistency check and repair.

  • ftp - Transfer/receive files from/to a remote host

  • groups - Print group names a user is in

  • gzip/gunzip - Compress or decompress named file(s)

  • head - Output the first part of file(s)

  • history - Command History

  • hostname - Print or set system name

  • id - Print user and group id's

  • info - Help info

  • join - Joins lines on a common field

  • kill - Stops a process from running

  • killall - Stops matching process from running

  • less - Display output one screen at a time

  • ln - Make links between files

  • locate - Find files using an indexed list.

  • logname - Print current login name

  • logout - Exit a login shell

  • lpc - Line printer control program

  • lpr - Off line print

  • lprint - Print a file

  • lprintq - List the print queue

  • ls - List information about file(s)

  • man - Help manual

  • mkdir - Create new folder(s)

  • more - Display output one screen at a time

  • mount - Mount a file system

  • mv - Move or rename files or directories

  • nice - Set the priority of a command or job

  • passwd - Modify a user password

  • printf - Format and print data

  • ps - Process Status. Lists running process

  • pwd - Print Working Directory

  • rgrep - Recursive grep

  • rm - Remove file(s)

  • rmdir - Remove folder(s)

  • rsync - Remote file copy (Synchronize file trees) using its own protocol. It may be used over an ssh or rsh connection.

  • scp - Copy files between two machines over an ssh connection

  • sdiff - Merge two files interactively

  • sed - Stream Editor

  • select - Accept keyboard input

  • sftp - Secure file transfer (FTP over SSH)

  • shutdown - Shutdown or restart Linux

  • sleep - Delay for a specified time

  • sort - Sort text files

  • ssh - Secure Shell

  • su - Substitute user identity

  • sync - Synchronize data on disk with memory

  • tail - Output the last part of files

  • tar - Tape Archiver

  • time - Measure Program Resource Use

  • top - List processes running on the system

  • touch - Change file timestamps or create an empty file

  • tr - Translate, squeeze, and/or delete characters

  • traceroute - Trace Route to Host

  • true - Do nothing, successfully

  • umask - Users file creation mask

  • umount - Unmount a device

  • uname - Print system information

  • uniq - Uniquify files

  • until - Execute commands (until error)

  • useradd - Create new user account

  • usermod - Modify user account

  • users - List users currently logged in

  • vdir - Verbosely list directory contents (ls -l -b)

  • watch - Execute/display a program periodically

  • wc - Print byte, word and line counts

  • which - Locate a program file in the user's path.

  • who - Print all usernames currently logged in

  • whoami - Print the current user id and name (`id -un')



CategoryCommandLineInterface