-
Notifications
You must be signed in to change notification settings - Fork 0
Linux General Commands
Oliver Sosa edited this page Mar 22, 2020
·
12 revisions
lsb_release -a
chmod -R 777 file
chown -R someuser:somegroup /path
chown -R user: /path # change owner but no group owner
sudo systemctl status mysql
#from local to remote
scp /path/to/file1 user@remotehost:/remotedir/file1
#from remote to local
scp user@remotehost:/remotedir/file1 /path/to/local/file1
#copy the 'remotedir' directory recursive to the current directory
scp -r user@remotehost:/remotedir .
#Zip
tar -c folder | bzip2 > folder.tar.bz2
#Unzip
tar jvxf file.tar.bz2
/usr/bin/bash -l -i -c "/opt/WebStorm-191.7479.14/bin/webstorm.sh"
- The redirection operator ''>'' causes a file creation, and if it does exist, the contents are overwritten.
- The redirection operator ''>>'' add information to the end of file, rather than replacing it.
netstat -nlt
free -m
df -h --total
df -i --total
#va mostrando lo nuevo que se le añade a fichero.log
tail -f fichero.log
sudo lshw -class network
sudo update-rc.d -f apache2 remove
sudo update-rc.d -f apache2 remove
du -sk -- * | sort -n | perl -pe '@SI=qw(K M G T P); s:^(\d+?)((\d\d\d)*)\s:$1." ".$SI[((length $2)/3)]."\t":e'
grep -r --include '*.list' '^deb ' /etc/apt/sources.list*
This command will save in /tmp/file_list_$FOLDER an alphabetically ordered list of all the files inside $FOLDER, complete with the corresponding sub-folders:
find $FOLDER -type f | cut -d/ -f2- | sort > /tmp/file_list_$FOLDER
The four command line switches r, v, c and n tell ''rsync'' to perform a ''v''erbose, ''r''ecursive, ''c''hecksum-based synchronization of the two directories, but only for show: ''-n'', in fact, displays what rsync would do IF you did let it free to make the second folder a perfect copy of the first one. The advantage of rsync is that can compare local directories with remote ones.
rsync -rvnc -delete todo_sync/ todo_orig/
And graphically you could use ''meld''
root (hd1,0)
kernel /boot/vmlinuz-3.0.0-20-generic root=/dev/sda1
initrd /boot/initrd-3.0.0-20-generic
boot