"Never memorize something you can look up", Albert Einstein

Most used UNIX commands

I love my Unix shell for quickly adjusting files or moving them to and from. The only problem with the shell on Unix-based systems is that you can forget these commands if you don’t use them on a regular base, I’ve got a big collection of these commands on Evernote, but after some requests of friend of mine to share them, I thought why not post it on my blog?

CommandMeaning
ssh user@serverConnect with user X to server X using SSH
sudo tar cvz—exclude “*.pdf”—exclude “*.png”—exclude “cache/*” -f output.tgz folder1 folder2Compress everything in folder1 and folder2 excluding everything with the pdf/png-extension and everything in cache-folders.
mysqldump -u user -p databaseX—ignore_table=table1 > output.sqlGet everything except table1 out the database with name ‘databaseX’ with the user ‘user’ and place it in output.sql
mysql -p databaseX < input.sqlPlace the content of file ‘input.sql’ into databaseX
sudo tar xvfz input.tgzExtract input.tgz
sudo ssh -L localport:localhost:remoteport user@server -NCreate SSH tunnel to server on localport to remoteport

 


Only members are allowed to post a comment.

Comments

Geplaatst door Isabella op 14-Dec-10 08:12

Good!!!

Geplaatst door studio33 op 12-Jul-11 02:07

Thanks for this help, I have been struggling with the change since I switched over.

sydney video production

Geplaatst door panacea2012 op 17-Feb-12 09:02

Great topic, thanks for sharing!  As a spiritual teacher you could benefit greatly from The Panacea Community.  Come check it out and share your advice with our online community when you have a chance.
Spiritual Teachers

Geplaatst door SanJoseSEO8 op 21-Feb-12 16:02

Highly pompous!Seriously observing that your site on the web-line establishes your well adorned presence, and I’m already impressed to see the site.
San Jose SEO