8339
Comment: WIP syntax fix
|
8191
WIP formatting, fix toc
|
Deletions are marked like this. | Additions are marked like this. |
Line 5: | Line 5: |
== Useful commands == Shell commands can refer to various things: |
A shell accepts various kinds of commands: |
Line 13: | Line 11: |
To find your way around the command-line in Debian and other Linux distributions, you will want to learn how to use some basic commands, then dive into more advanced shell scripting progressively. Here is a list of commonly used commands, along with some examples. Each command link to its manpage or wiki page. To get more info about a command, remember to use ManPages. It's your first help ! To know what package provides a specific program, use ''Search the contents of packages'' on https://packages.debian.org/ |
The [[coreutils]] page lists basic command-line utilities you will probably want to know to use Debian or an GNU/Linux system. Here is a list of commonly used commands, along with some examples. Each command link to its manpage or wiki page. To get more info about a command, remember to use ManPages! Use https://manpages.debian.org/ to browse and search for manpages. |
Line 29: | Line 25: |
* {{{cd}}} - change the shell working directory. | * '''{{{cd}}}''' - change the shell working directory. |
Line 33: | Line 29: |
== Text search/replace/manipulation == The following tools can help you perform complex searches, replacements and scripted editing in text files: |
== Compression == See [[Compression]] == Other commands == These commands are provided by various Debian packages. To know what package provides a specific program, use ''Search the contents of packages'' on https://packages.debian.org/ |
Line 39: | Line 43: |
== Compression == See [[Compression]] == Other programs == |
A shell accepts various kinds of commands:
executable programs installed from Debian packages
built-ins provided by the shell
- manually installed executable programs
The coreutils page lists basic command-line utilities you will probably want to know to use Debian or an GNU/Linux system.
Here is a list of commonly used commands, along with some examples. Each command link to its manpage or wiki page. To get more info about a command, remember to use ?ManPages!
Use https://manpages.debian.org/ to browse and search for manpages.
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
These commands are provided by various Debian packages.
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
TODO: everything below
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
D
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
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).
du: Estimate file space usage
E
eject: Eject CD-ROM
env: Display, set, or remove environment variables
exit: Exit the shell (or press Ctrl-D)
export: Set an environment variable
F
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
G
groups: Print group names a user is in
gzip/gunzip: Compress or decompress named file(s)
H
head: Output the first part of file(s)
history: Command History
hostname: Print or set system name
I
id: Print user and group id's
if/then/else/elif/fi Conditionally perform a command
info: Help info
J
join: Joins lines on a common field
K
kill: Stops a process from running
killall: Stops matching process from running
L
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)
M
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
N
nice: Set the priority of a command or job
P
passwd: Modify a user password
printf: Format and print data
ps: Process Status. Lists running process
pwd: Print Working Directory
Q
R
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.
S
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
sudo: Execute a command as another user
sync: Synchronize data on disk with memory
T
tail: Output the last part of files
tar: Tape Archiver
time: Measure Program Resource Use
touch: Change file timestamps or create an empty file
top: List processes running on the system
traceroute: Trace Route to Host
tr: Translate, squeeze, and/or delete characters
true: Do nothing, successfully
U
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
V
vdir: Verbosely list directory contents (ls -l -b)
W
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')
other
. : See source
#: Comment / Remark.
External links
https://www.bestsevenreviews.com/all-about-linux/ - An Overview of the Linux OS for Newbies
Work in progress refactor this page
TODO link to unix books
TODO CategoryRedundant: merge with ShellToolTricks, PrincipalCommands coreutils, Shell, ?dash, Sh