gnome-control-center : open system settings from terminal
xclip -selection clipboard : to copy output directly to clipboard
Command
Usage
ssh
ssh (SSH client) is a program for logging into a remote machine and for executing commands on a remote machine.
ls
List information about the FILEs (the current directory by default).
cd
Change Directory
cat
Concatenate files and print on the standard output
file
determine file type
du
estimate file space usage
find
search for files in a directory hierarchy
grep
print lines that match patterns
sort
sort lines of text files
uniq
report or omit repeated lines
strings
print the sequences of printable characters in files
base64
base64 encode/decode data and print to standard output
tr
Translate, squeeze, and/or delete characters from standard input, writing to standard output.
tar
an archiving utility
gzip
compress or expand files
bzip2
a block-sorting file compressor
xxd
make a hexdump or do the reverse.
mkdir
make directories
cp
copy files and directories
mv
move files and directories
telnet
The telnet command is used for interactive communication with another host using the TELNET protocol
nc
netcat is a simple unix utility which reads and writes data across network connections, using TCP or UDP protocol.
openssl
OpenSSL command line tool
s_client
The s_client command implements a generic SSL/TLS client which connects to a remote host using SSL/TLS. It is a very useful diagnostic tool for SSL servers.
nmap
Network exploration tool and security / port scanner
diff
compare files line by line
bash
Bash is an sh-compatible command language interpreter
screen
Screen is a full-screen window manager that multiplexes a physical terminal between several processes
tmux
tmux is a terminal multiplexer: it enables a number of terminals to be created, accessed, and controlled from a single screen.
bg
background a process
fg
foreground a process
jobs
list processes running in background
&
run a command in background
cron
daemon to execute scheduled commands
crontab
maintain crontab files for individual users
crontab(5)
tables for driving cron
more
file perusal filter for crt viewing
less
opposite of more
vi
vim - Vi IMproved, a programmer's text editor
id
print real and effective user and group IDs
pwd
print working directory
git
the stupid content tracker
locate
find files by name, quickly
man
an interface to the system reference manuals
which
locate a command
type
lets you query the type of each command.
ps
report a snapshot of the current processes.
kill
send a signal to a process
uname
print system information
chmod
change file mode bits
chown
change file owner and group
chgrp
change group ownership
tail
output the last part of files
ln
make link between files
cat ./- (./ - stands for current directory) : cat a file with name "-"
cat ./-filename : cat a file whose name starts with "-"
cat \spaces \in \this \filename.txt (Original filename: spaces in this filename.txt ) - cat a file name with spaces
base64 -d data.txt - base64 decode a file
strings filename - output human readable text from non-humanreadable file:
echo "acbdlksjfla KHLKJfdlsfasd" | tr 'A-Za-z' 'N-ZA-Mn-za-m' - rotate a text with all lowercase and uppercase by 13 positions:
openssl s_client -connect <host>:<port> : connect a host with ssl encryption
diff fileone filetwo : check difference
tail -n <number of lines> <path & file name> : print last n lines of a file
ln -s tmp/files/take-the-command-challenge take-the-command-challenge : Create a symbolic link named take-the-command-challenge that points to the file tmp/files/take-the-command-challenge.
find . -delete : Delete all of the files in this challenge directory including all subdirectories and their contents.
grep -rl 500: -r for Recursive, read all files in given directory and subdirectories & -l for Print the name of each file which contains a match.
Note: These are my notes for personal reference!
๐๐๐ฌ๐ข๐
date : displays the current time and date
โโโ(shreyasใฟkali)-[~]
โโ$ date
Tuesday 04 January 2022 03:39:43 PM IST
cal : displays a calendar of the current month
โโโ(shreyasใฟkali)-[~]
โโ$ cal
January 2022
Su Mo Tu We Th Fr Sa
1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31
df : the current amount of free space on our disk drives
โโโ(shreyasใฟkali)-[~]
โโ$ cd practise
โโโ(shreyasใฟkali)-[~/practise]
โโ$ pwd
/home/shreyas/practise
โโโ(shreyasใฟkali)-[~/practise]
โโ$ ls
hackthebox
cd shortcuts
Shortcut
Result
cd
Changes the working directory to your home directory.
cd -
Changes the working directory to the previous working directory.
cd ~user_name
Changes the working directory to the home directory of user_name. For example, typing cd ~bob will change the directory to the home directory of user โbob.โ
ls : List directory contents
ls -l: output in long format
ls -t: the t option to sort the result by the fileโs modification time.
ls -lt --reverse: --reverse to reverse the order of the sort.
โโโ(shreyasใฟkali)-[~]
โโ$ ls
BugBounty Documents Music practise Templates
Desktop Downloads Pictures Public Videos
โโโ(shreyasใฟkali)-[~]
โโ$ ls /usr
bin games include lib lib32 lib64 libexec libx32 local sbin share src
โโโ(shreyasใฟkali)-[~]
โโ$ ls practise /usr
practise:
hackthebox
/usr:
bin games include lib lib32 lib64 libexec libx32 local sbin share src
โโโ(shreyasใฟkali)-[~]
โโ$ ls -l
total 176
drwxr-xr-x 3 shreyas shreyas 4096 Jan 1 17:38 BugBounty
drwxr-xr-x 2 shreyas shreyas 4096 Dec 14 19:34 Desktop
drwxr-xr-x 2 shreyas shreyas 4096 Dec 14 19:34 Documents
drwxr-xr-x 3 shreyas shreyas 4096 Dec 29 15:32 Downloads
drwxr-xr-x 2 shreyas shreyas 4096 Dec 14 19:34 Music
drwxr-xr-x 2 shreyas shreyas 4096 Dec 14 19:34 Pictures
drwxr-xr-x 3 shreyas shreyas 4096 Dec 26 21:40 practise
drwxr-xr-x 2 shreyas shreyas 4096 Dec 14 19:34 Public
drwxr-xr-x 2 shreyas shreyas 4096 Dec 14 19:34 Templates
drwxr-xr-x 2 shreyas shreyas 4096 Dec 14 19:34 Videos
โโโ(shreyasใฟkali)-[~]
โโ$ ls -lt
total 40
drwxr-xr-x 3 shreyas shreyas 4096 Jan 1 17:38 BugBounty
drwxr-xr-x 3 shreyas shreyas 4096 Dec 29 15:32 Downloads
drwxr-xr-x 3 shreyas shreyas 4096 Dec 26 21:40 practise
drwxr-xr-x 2 shreyas shreyas 4096 Dec 14 19:34 Desktop
drwxr-xr-x 2 shreyas shreyas 4096 Dec 14 19:34 Documents
drwxr-xr-x 2 shreyas shreyas 4096 Dec 14 19:34 Music
drwxr-xr-x 2 shreyas shreyas 4096 Dec 14 19:34 Pictures
drwxr-xr-x 2 shreyas shreyas 4096 Dec 14 19:34 Public
drwxr-xr-x 2 shreyas shreyas 4096 Dec 14 19:34 Templates
drwxr-xr-x 2 shreyas shreyas 4096 Dec 14 19:34 Videos
โโโ(shreyasใฟkali)-[~]
โโ$ ls -lt --reverse 2 โจฏ
total 40
drwxr-xr-x 2 shreyas shreyas 4096 Dec 14 19:34 Videos
drwxr-xr-x 2 shreyas shreyas 4096 Dec 14 19:34 Templates
drwxr-xr-x 2 shreyas shreyas 4096 Dec 14 19:34 Public
drwxr-xr-x 2 shreyas shreyas 4096 Dec 14 19:34 Pictures
drwxr-xr-x 2 shreyas shreyas 4096 Dec 14 19:34 Music
drwxr-xr-x 2 shreyas shreyas 4096 Dec 14 19:34 Documents
drwxr-xr-x 2 shreyas shreyas 4096 Dec 14 19:34 Desktop
drwxr-xr-x 3 shreyas shreyas 4096 Dec 26 21:40 practise
drwxr-xr-x 3 shreyas shreyas 4096 Dec 29 15:32 Downloads
drwxr-xr-x 3 shreyas shreyas 4096 Jan 1 17:38 BugBounty
file filename : the file command will print a brief description of the fileโs contents
โโโ(shreyasใฟkali)-[~/practise/hackthebox]
โโ$ file flag.txt
flag.txt: ASCII text, with no line terminators
โโโ(shreyasใฟkali)-[~/practise/hackthebox]
โโ$ file pack.ovpn
pack.ovpn: ASCII text
less : allows us to scroll forward and backward through a text file.
Note: less is more. Means both commands are same
โโโ(shreyasใฟkali)-[~/practise/hackthebox]
โโ$ cat example | less
โโโ(shreyasใฟkali)-[~/practise/hackthebox]
โโ$ less example
Command
Action
PAGE UP or b
Scroll back one page
PAGE DOWN or space
Scroll forward one page
Up arrow
Scroll up one line
Down arrow
Scroll down one line
G
Move to the end of the text file
1G or g
Move to the beginning of the text file
/characters
Search forward to the next occurrence of characters
n
Search for the next occurrence of the previous search
cp item1 item2 : copy single file item1 into item2
cp item... directory : copies multiple items (either files or directories) into a directory.
Option
Meaning
-a,--archive
Copy the files and directories and all of their attributes, including ownerships and permissions.
-i, --interactive
Before overwriting an existing file, prompt the user for confirmation.
-r, --recursive
Recursively copy directories and their contents. This option (or the -a option) is required when copying directories.
-u, --update
When copying files from one directory to another, only copy files that either donโt exist or are newer than the existing corresponding files in the destination directory. This is useful when copying large numbers of files as it skips files that donโt need to be copied
-v, --verbose
Display informative messages as the copy is performed.
mv is same as cp
rm file : remove files and directories
Option
Meaning
-i, --interactive
Before deleting an existing file, prompt the user for confirmation.
-r, --recursive
Recursively delete directories. This means that if a directory being deleted has subdirectories, delete them too. To delete a directory, this option must be specified.
-f, --force
Ignore nonexistent files and do not prompt. This overrides the --interactive option.
-v, --verbose
Display informative messages as the deletion is performed.
type: is a shell builtin that displays the kind of command the shell will execute
โโโ(shreyasใฟkali)-[~/practise/commandline]
โโ$ type ls
ls is an alias for ls --color=auto
โโโ(shreyasใฟkali)-[~/practise/commandline]
โโ$ type ssh
ssh is /usr/bin/ssh
โโโ(shreyasใฟkali)-[~/practise/commandline]
โโ$ type cd
cd is a shell builtin
which : Display an Executableโs Location
โโโ(shreyasใฟkali)-[~/practise/commandline]
โโ$ which ls
ls: aliased to ls --color=auto
โโโ(shreyasใฟkali)-[~/practise/commandline]
โโ$ which pwd
pwd: shell built-in command
โโโ(shreyasใฟkali)-[~/practise/commandline]
โโ$ which cd
cd: shell built-in command
โโโ(shreyasใฟkali)-[~/practise/commandline]
โโ$ which gedit
/usr/bin/gedit
โโโ(shreyasใฟkali)-[~/practise/commandline]
โโ$ which firefox
/usr/bin/firefox
man : Display a Programโs Manual Page
โโโ(shreyasใฟkali)-[~/practise/commandline]
โโ$ man ls
LS(1) User Commands LS(1)
NAME
ls - list directory contents
SYNOPSIS
ls [OPTION]... [FILE]...
DESCRIPTION
List information about the FILEs (the current directory by default). Sort
entries alphabetically if none of -cftuvSUX nor --sort is specified.
Mandatory arguments to long options are mandatory for short options too.
-a, --all
do not ignore entries starting with .
-A, --almost-all
do not list implied . and ..
--author
with -l, print the author of each file
Manual page ls(1) line 1 (press h for help or q to quit)
apropos - Display Appropriate Commands
โโโ(shreyasใฟkali)-[~/practise/commandline]
โโ$ apropos copy
cifsdd (8) - convert and copy a file over SMB
COPY (7) - copy data between a file and a table
cp (1) - copy files and directories
cpgr (8) - copy with locking the given file to the password or group file
cpio (1) - copy files to and from archives
cppw (8) - copy with locking the given file to the password or group file
dd (1) - convert and copy a file
debconf-copydb (1) - copy a debconf database
git-checkout-index (1) - Copy files from the index to the working tree
gvfs-copy (1) - Deprecated equivalent of gio copy
install (1) - copy files and set attributes
mariadb-hotcopy (1) - a database backup program
mysqlhotcopy (1) - a database backup program
ntfscp (8) - copy file to an NTFS volume.
objcopy (1) - copy and translate object files
ptrepack (1) - Copy any PyTables Leaf, Group or complete subtree into anothe...
rcp (1) - OpenSSH secure file copy
rsync (1) - a fast, versatile, remote (and local) file-copying tool
scp (1) - OpenSSH secure file copy
ssh-copy-id (1) - use locally available keys to authorise logins on a remote ma...
svnversion (1) - Produce a compact version identifier for a working copy.
vfs_shadow_copy (8) - Expose snapshots to Windows clients as shadow copies.
vfs_shadow_copy2 (8) - Expose snapshots to Windows clients as shadow copies.
x86_64-linux-gnu-objcopy (1) - copy and translate object files
โโโ(shreyasใฟkali)-[~/practise/commandline]
โโ$ whatis rm
rm (1) - remove files or directories
โโโ(shreyasใฟkali)-[~/practise/commandline]
โโ$ whatis ls
ls (1) - list directory contents
โโโ(shreyasใฟkali)-[~/practise/commandline]
โโ$ whatis sudo
sudo (8) - execute a command as another user
info : Display a Programโs Info Entry
โโโ(shreyasใฟkali)-[~/practise/commandline]
โโ$ info ls
Next: dir invocation, Up: Directory listing
10.1 โlsโ: List directory contents
==================================
The โlsโ program lists information about files (of any type, including
directories). Options and file arguments can be intermixed arbitrarily,
as usual.
For non-option command-line arguments that are directories, by
default โlsโ lists the contents of directories, not recursively, and
omitting files with names beginning with โ.โ. For other non-option
arguments, by default โlsโ lists just the file name. If no non-option
argument is specified, โlsโ operates on the current directory, acting as
if it had been invoked with a single argument of โ.โ.
By default, the output is sorted alphabetically, according to the
locale settings in effect.(1) If standard output is a terminal, the
output is in columns (sorted vertically) and control characters are
output as question marks; otherwise, the output is listed one per line
and control characters are output as-is.
-----Info: (coreutils)ls invocation, 56 lines --Top------------------------------------
Follow xref: gument is specified, โlsโ operates on the current directory, acting asif
alias : Creating Our Own Commands with alias
trick: Itโs possible to put more than one command on a line by separating each command with a semicolon
command1; command2; command3...
[me@linuxbox ~]$ cd /usr; ls; cd -
bin games include lib local sbin share src
/home/me
[me@linuxbox ~]$
[me@linuxbox ~]$ type foo
bash: type: foo: not found
[me@linuxbox ~]$ alias foo='cd /usr; ls; cd -'
[me@linuxbox ~]$ foo
bin games include lib local sbin share src
/home/me
[me@linuxbox ~]$
[me@linuxbox ~]$ type foo
foo is aliased to `cd /usr; ls; cd -'
[me@linuxbox ~]$ unalias foo
[me@linuxbox ~]$ type foo
bash: type: foo: not found
๐๐๐๐ข๐ซ๐๐๐ญ๐ข๐จ๐ง
<command> > <file> : Redirecting Standard Output
โโโ(shreyasใฟkali)-[~/practise/commandline]
โโ$ ls -l /usr/bin > ls-output.txt
โโโ(shreyasใฟkali)-[~/practise/commandline]
โโ$ ls -l
total 180
drwxr-xr-x 2 shreyas shreyas 4096 Jan 4 17:21 dir1
drwxr-xr-x 2 shreyas shreyas 4096 Jan 4 17:21 dir2
drwxr-xr-x 2 shreyas shreyas 4096 Jan 4 17:21 dir3
-rw-r--r-- 1 shreyas shreyas 171639 Jan 4 18:21 ls-output.txt
command >> file - append redirected output to a file instead of overwriting the file
[me@linuxbox ~]$ ls -l /usr/bin >> ls-output.txt
0> OR < : redirecting standard input
> : redirecting standard output
2> : redirecting standard error
[me@linuxbox ~]$ ls -l /bin/usr 2> ls-error.txt
ls -l /bin/usr > ls-output.txt 2>&1 OR ls -l /bin/usr &> ls-output.txt: Redirecting Standard Output and Standard Error to One File
ls -l /bin/usr 2> /dev/null : Disposing unwanted output
command1 | command2 : Pipeline
wc : Print line, Word, and Byte counts
grep : print line matching pattern
head -n <number of lines> ls-output.txt : print initial lines of file
tail -n <number of lines> ls-output.txt : print last lines of files
tee : Read from Stdin and Output to Stdout and Files
Double Quotes: If we place text inside double quotes, all the special characters used by the shell lose their special meaning and are treated as ordinary characters. The exceptions are $ (dollar sign), \ (backslash), and ` (backtick).
Single Quotes: If we need to suppress all expansions, we use single quotes.
Escaping Characters:
\ : is used for escaping
Backslash Escape Situation:
Escape Sequence
Meaning
\a
Bell (an alert that causes the computer to beep)
\b
Backspace
\n
Newline; on Unix-like systems, this produces a line feed
\r
Carriage return
\t
tab
โโโ(shreyasใฟkali)-[~]
โโ$ sleep 10; echo -e "Time's up\a"
Time's up
Move cursor forward one character; same as the right arrow key
CTRL-B
Move cursor backward one character; same as the left arrow key
ALT-F
Move cursor one word forward
ALT-B
Move cursor backward one word
CTRL-L
Clear screen and move the cursor to the top left corner. Same as clear command
Modifying Text
Key
Action
CTRL-D
Delete the character at the cursor location
CTRL-T
Transpose the character at the cursor location
ALT-T
Transpose the word at the cursor location with the one preceding it.
ALT-L
Convert the characters from the cursor location to the end of the word to lowercase.
ALT-U
Convert the characters from the cursor location to the end of the word to uppercase.
History Expansion
Sequence
Action
!!
Repeat the last command. It is probably easier to press the up arrow and ENTER
!number
Repeat history list item number.
!string
Repeat last history list item starting with string
!?string
Repeat last history list item containing string
๐๐๐ซ๐ฆ๐ข๐ฌ๐ฌ๐ข๐จ๐ง๐ฌ
id : Display user identity
chmod : Change a fileโs mode
umask : Set the default file permissions
su : Run a shell as another user
sudo : Execute a command as another user
chown: Change a fileโs owner
chgrp: Change a fileโs group ownership
passwd: Change a userโs password
Permission attribute Examples:
File Attributes
Meaning
-rwx------
A regular file that is readable, writable, and executable by the fileโs owner. No one else has any access.
-rw-------
A regular file that is readable and writable by the fileโs owner. No one else has any access.
-rw-r--r--
A regular file that is readable and writable by the fileโs owner. Members of the fileโs owner group may read the file. The file is world-readable.
-rwxr-xr-x
A regular file that is readable, writable, and executable by the fileโs owner. The file may be read and executed by everybody else.
-rw-rw----
A regular file that is readable and writable by the fileโs owner and members of the fileโs group owner only.
lrwxrwxrwx
A symbolic link. All symbolic links have โdummyโ permissions. The real permissions are kept with the actual file pointed to by the symbolic link.
drwxrwx---
A directory. The owner and the members of the owner group may enter the directory and create, rename, and remove files within the directory.
drwxr-x---
A directory. The owner may enter the directory and create, rename, and delete files within the directory. Members of the owner group may enter the directory but cannot create, delete, or rename files.
chmod : Change File Mode
6(rw-)
7(rwx)
5(r-x)
4(r--)
0(---)
Symbol
Meaning
u
Short for "user" but means the file or directory owner.
g
Group owner
o
Short for "others" but means world
a
Short for "all". This is a combination of u, g, and o.
If no character is specified, โallโ will be assumed. The operation may be a + indicating that a permission is to be added, a - indicating that a permission is to be taken away, or a = indicating that only the specified permissions are to be applied and that all others are to be removed.
Notation
Meaning
u+x
Add execute permission for the owner.
u-x
Remove execute permission from the owner.
+x
Add execute permission for the owner, group, and world. This is equivalent to a+x.
o-rw
Remove the read and write permissions from anyone besides the owner and group owner.
go=rw
Set the group owner and anyone besides the owner to have read and write permissions. If either the group owner or the world previously had execute permission, it is removed.
u+x,go=rx
Add execute permission for the owner and set the permissions for the group and others to read and execute. Multiple specifications may be separated by commas.
๐๐ซ๐จ๐๐๐ฌ๐ฌ๐๐ฌ
ps : Report a snapshot of current processes
top : Display tasks
jobs : List active jobs
bg : Place a job in the background
fg : Place a job in the foreground
kill : Send a signal to a process
killall : Kill process by name
shutdown : Shut down or reboot the system
๐๐๐ญ๐ฐ๐จ๐ซ๐ค๐ข๐ง๐
ping : Checks if a network is reachable, ping command sends a special network packet called an ICMP ECHO_REQUEST to a specified host. Most network devices receiving this packet will reply to it, allowing the network connection to be verified.
โโโ(shreyasใฟkali)-[~]
โโ$ ping youtube.com
PING youtube.com (142.250.204.46) 56(84) bytes of data.
64 bytes from hkg07s38-in-f14.1e100.net (142.250.204.46): icmp_seq=1 ttl=128 time=149 ms
64 bytes from hkg07s38-in-f14.1e100.net (142.250.204.46): icmp_seq=2 ttl=128 time=151 ms
64 bytes from hkg07s38-in-f14.1e100.net (142.250.204.46): icmp_seq=3 ttl=128 time=188 ms
64 bytes from hkg07s38-in-f14.1e100.net (142.250.204.46): icmp_seq=4 ttl=128 time=140 ms
64 bytes from hkg07s38-in-f14.1e100.net (142.250.204.46): icmp_seq=5 ttl=128 time=139 ms
64 bytes from hkg07s38-in-f14.1e100.net (142.250.204.46): icmp_seq=6 ttl=128 time=120 ms
64 bytes from hkg07s38-in-f14.1e100.net (142.250.204.46): icmp_seq=7 ttl=128 time=131 ms
64 bytes from hkg07s38-in-f14.1e100.net (142.250.204.46): icmp_seq=8 ttl=128 time=148 ms
64 bytes from hkg07s38-in-f14.1e100.net (142.250.204.46): icmp_seq=9 ttl=128 time=137 ms
64 bytes from hkg07s38-in-f14.1e100.net (142.250.204.46): icmp_seq=10 ttl=128 time=132 ms
64 bytes from hkg07s38-in-f14.1e100.net (142.250.204.46): icmp_seq=11 ttl=128 time=144 ms
64 bytes from hkg07s38-in-f14.1e100.net (142.250.204.46): icmp_seq=12 ttl=128 time=128 ms
64 bytes from hkg07s38-in-f14.1e100.net (142.250.204.46): icmp_seq=13 ttl=128 time=128 ms
64 bytes from hkg07s38-in-f14.1e100.net (142.250.204.46): icmp_seq=14 ttl=128 time=141 ms
64 bytes from hkg07s38-in-f14.1e100.net (142.250.204.46): icmp_seq=15 ttl=128 time=135 ms
64 bytes from hkg07s38-in-f14.1e100.net (142.250.204.46): icmp_seq=16 ttl=128 time=130 ms
64 bytes from hkg07s38-in-f14.1e100.net (142.250.204.46): icmp_seq=17 ttl=128 time=133 ms
64 bytes from hkg07s38-in-f14.1e100.net (142.250.204.46): icmp_seq=18 ttl=128 time=142 ms
64 bytes from hkg07s38-in-f14.1e100.net (142.250.204.46): icmp_seq=19 ttl=128 time=134 ms
64 bytes from hkg07s38-in-f14.1e100.net (142.250.204.46): icmp_seq=20 ttl=128 time=137 ms
64 bytes from hkg07s38-in-f14.1e100.net (142.250.204.46): icmp_seq=21 ttl=128 time=139 ms
^C64 bytes from hkg07s38-in-f14.1e100.net (142.250.204.46): icmp_seq=22 ttl=128 time=140 ms
64 bytes from hkg07s38-in-f14.1e100.net (142.250.204.46): icmp_seq=23 ttl=128 time=121 ms
64 bytes from hkg07s38-in-f14.1e100.net (142.250.204.46): icmp_seq=24 ttl=128 time=146 ms
64 bytes from hkg07s38-in-f14.1e100.net (142.250.204.46): icmp_seq=25 ttl=128 time=136 ms
64 bytes from hkg07s38-in-f14.1e100.net (142.250.204.46): icmp_seq=26 ttl=128 time=165 ms
64 bytes from hkg07s38-in-f14.1e100.net (142.250.204.46): icmp_seq=27 ttl=128 time=176 ms
64 bytes from hkg07s38-in-f14.1e100.net (142.250.204.46): icmp_seq=28 ttl=128 time=132 ms
^C
--- youtube.com ping statistics ---
28 packets transmitted, 28 received, 0% packet loss, time 27045ms
rtt min/avg/max/mdev = 120.372/140.817/187.758/14.526 ms
traceroute : lists all the โhopsโ network traffic takes to get from the local system to a specified host.
ftp : ftp is used to communicate with FTP servers, machines that contain files that can be uploaded and downloaded over a network. FTP (in its original form) is not secure because it sends account names and passwords in cleartext.
[me@linuxbox ~]$ ftp fileserver
Connected to fileserver.localdomain.
220 (vsFTPd 2.0.1)
Name (fileserver:me): anonymous
331 Please specify the password.
Password:
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> cd pub/cd_images/ubuntu-18.04
250 Directory successfully changed.
ftp> ls
200 PORT command successful. Consider using PASV.
150 Here comes the directory listing.
-rw-rw-r-- 1 500 500 733079552 Apr 25 03:53 ubuntu-18.04-desktop-amd64.iso
226 Directory send OK.
ftp> lcd Desktop
Local directory now /home/me/Desktop
ftp> get ubuntu-18.04-desktop-amd64.iso
local: ubuntu-18.04-desktop-amd64.iso remote: ubuntu-18.04-desktop-amd64.iso
200 PORT command successful. Consider using PASV.
150 Opening BINARY mode data connection for ubuntu-18.04-desktop-amd64.iso (733079552 bytes).
226 File send OK.
733079552 bytes received in 68.56 secs (10441.5 kB/s)
ftp> bye
Command
Meaning
ftp fileserver
Invoke the ftp program and have it connect the FTP server fileserver
anonymous
Login name. After the login prompt, a password prompt will appear. Some servers will accept a blank password; others will require a password in the form of an email address. In that case, try something like user@example.
cd
change directory
ls
list directory
lcd Desktop
Change the directory on the local system to ~/Desktop. In the example, the ftp program was invoked when the working directory was ~. This command changes the working directory to ~/Desktop.
get
transfer file from remote server to local system
bye
Log off the remote server and end the ftp program session. The commands quit and exit may also be used.
lftp is a Better ftp
wget : It is useful for downloading content from both web and FTP sites. Single files, multiple files, and even entire sites can be downloaded.
ssh : SSH solves the two basic problems of secure communication with a remote host.
It authenticates that the remote host is who it says it is (thus preventing so-called man-in-the-middle attacks).
It encrypts all of the communications between the local and remote hosts.
ssh remote-sys : To connect to a remote host named remote-sys
ssh username@remote-sys : login with specific username
ssh remote-sys <command>: to execute just a single command
[me@linuxbox ~]$ ssh remote-sys
The authenticity of host 'remote-sys (192.168.1.4)' can't be established.
RSA key fingerprint is 41:ed:7a:df:23:19:bf:3c:a5:17:bc:61:b3:7f:d9:bb.
Are you sure you want to continue connecting (yes/no)?
scp - (secure copy). copy files from local host to remote host
xargs - It accepts input from standard input and converts it into an argument list for a specified command
find ~ -type f -name 'foo*' -print | xargs ls -l
-rwxr-xr-x 1 me me 224 2007-10-29 18:44 /home/me/bin/foo
-rw-r--r-- 1 me me 0 2016-09-19 12:53 /home/me/foo.txt