File Management: Applicable SSH commands

Step 1:

In some webhosting plans it's possible to access your data via SSH. The following commands are available:

 
Files and folders
cat, tac, less, more Output of a file content cat <file>
cd Switches the directory cd <directory>
chmod Changes privileges of files/folders chmod -R 777 <directory>
cmp, diff Comparison of two files cmp <file1> <file2>
cp Copies files/folders cp <file1> <file2>
csplit, split Splits files  
cut Cuts columns or fields from files  
dir Alias for ls -a1h dir
du Evaluates the storage footprint of files/folders du --max-depth=1 -h
grep, egrep, fgrep Searches in files grep -i <text> <file>
file Determines the file type file -i <file>
find Searches for files find -name "<file>"
head Output of the initial lines of a file head <file>
join Merges files join <file1> <file2>
ln Creates a link pointing to a file/folder ln -s <ziel> <name>
ls Lists files/folders ls -al
ll Alias for ls -al ll
la Alias for ls -A la
l Alias for ls -alF l
mc Midnight Commander mc
md5sum, sha1sum, sum Determines the checksum of a file md5sum <file>
mkdir Creates a new folder mkdir <directory>
mv Renames/moves files/folders mv <file1> <file2>
nl Displays the content of a file with line numbers nl <file>
patch Shows changes to a file on the basis of a diff file patch < patch.diff
pwd Shows the current folder pwd
rename Renames files rename 's/<text1>/<text2>/g' *
rm Deletes files/folders rm <file>
rmdir Deletes an empty folder rmdir <directory>
sort Assorts the content of a file sort <file> > <file_sortiert>
tail Output of a file content from a certain line on tail -n 3 <file>
touch Changes the time stamp of a file touch <file>
unlink Deletes files unlink <file>
wc Displays the number of lines, terms and characters in a file wc <file>
Compressing and archiving
bzcat, bzless, bzmore Output of the content of bzip2 archives bzcat <file>
bzcmp, bzdiff Compares the the content of bzip2 archives bzcmp <file1> <file2>
bzegrep, bzfgrep, bzgrep Browses files inside bzip2 archives bzegrep <text> <file>
bzip2, bunzip2 Packs/unpacks files using bzip2 bunzip2 <file>
bzip2recover Restores defective bzip2 archives bzip2recover <file>
gzip, gunzip Packs/unpacks files using gzip gunzip <file>
tar Archives files and folders tar cfvz backup.tar.gz <directory>
zcat, zless, zmore Shows the content of gzip archives zcat <file>
zcmp, zdiff Compares the the content of gzip archives zcmp <file1> <file2>
zegrep, zfgrep, zgrep Browses files inside gzip archives zegrep <text> <file>
zip, unzip Packs/unpacks files using zip unzip <file>
Editors
joe, mcedit, vim/vi, nano Edits files mcedit <file>
sed, awk, gawk Transforms strings  
Network
curl Transmits files curl <url>
dig, nslookup DNS server query  
ftp Establishes an FTP connection ftp <hostname>
rsync Aligns data between source and target rsync <quelle> <ziel>
scp Securely transmits files via the network scp <user>@<hostname>
sftp Establishes an SFTP connection sftp <hostname>
ssh Establishes a secure connection to another client ssh <user>@<hostname>
wget Downloads files via HTTP/FTP wget <hostname>/<file>
Scripting languages
php PHP Interpreter php <file>
composer Package Manager for PHP composer
pear Pear  
perl Perl perl <file>
python, python2, python3 Python python <file>
MySQL
mysqldump Creates a database dump mysqldump -u LOGIN -p'PASSWORT'  LOGIN > dumpDATUM.sql
mysql Establishes a database connection, e.g. in order to restore a database backup mysql -u LOGIN -p'PASSWORT' LOGIN < dumpDATUM.sql
Version Control
bzr    
git    
svn Subversion Client  
Terminal, Shell, Background processes
< Input redirection <command> < <file>
> Redirects the output into a file <command> > <file>
>> Attaches the output to a file <command> >> <file>
| Output redirection find | grep <file>
source Reads and executes commands from a file source <file>
& Initiates background processes <command> &
2> Redirects the error output <command> 2> <file>
alias Sets a shortcut for a command alias ll='ls -al'
bg Continues background processes  
clear Clears the screen content  clear
export Exports environment variables export <var>
fg Continues foreground processes  
hash Displays the path names of already executed commands hash
history Displays the already executed commands  history
jobs Lists halted background processes  
printenv, set Displays/changes environment variables  
pv Monitors the progression of a task  
reset Restores the terminal character set  reset
sleep Puts a process to sleep  
[Strg] + c Aborts the current process in the shell ab  
[Strg] + z Halts the current process in the shell  
stty Queries/changes terminal settings  
unalias Deletes the alias of a command unalias ll
watch Periodically executes the command and shows output  
Miscellaneous
date Displays date and time  date
echo Output of text echo "Hello World!"
exit Terminates the current session exit
expand Converts tabs into spaces  expand <file>
expr Performs calculations expr 1 + 1
groups Displays the groups of the current user  groups
hostname Displays the own hostname hostname
iconv, recode Converts character sets  
id Displays the own username/group name id
kill Send signals to processes, e.g. in order to terminate them  
time Performs time measurements of processes time <command>
tr Replaces characters  
uname Displays system informations uname -a
unexpand Converts spaces into tabs unexpand <file>
uniq One-time output of identical, batched lines  
whoami Displays the own login name whoami

How helpful was this tutorial?

Search in support and FAQ

Seitensuche