{"id":554,"date":"2011-09-16T15:04:40","date_gmt":"2011-09-17T01:04:40","guid":{"rendered":"http:\/\/mymonkeydo.com\/?p=554"},"modified":"2023-10-19T06:58:28","modified_gmt":"2023-10-19T16:58:28","slug":"useful-linux-commands","status":"publish","type":"post","link":"https:\/\/mymonkeydo.com\/useful-linux-commands\/","title":{"rendered":"Useful Linux Commands"},"content":{"rendered":"
I recently had to move a server and needed to set up another server. I’m a linux newbie so I needed to look up a lot of things. Below are some of the more common commands that I needed: (replace with your own command\/name).<\/p>\n
alias =''<\/pre>\nCreate a symbolic link to another directory\/file<\/h2>\n
ln -s<\/pre>\nhttp:\/\/kb.iu.edu\/data\/abbe.html<\/p>\n
Transfer files from your computer to a server<\/h2>\n
scp :<\/pre>\nTransfer files from a server to another server.<\/h2>\n
scp : :<\/pre>\nChange file owner w\/ recursion<\/h2>\n
chown -R :<\/pre>\nChange file permissions for web w\/ recursion<\/h2>\n
chmod -R 644<\/pre>\nFind a file<\/h2>\n
find \/ -name<\/pre>\nhttp:\/\/content.hccfl.edu\/pollock\/unix\/findcmd.htm<\/p>\n
Add a user<\/h2>\n
sudo useradd -d \/home\/ -m<\/pre>\nsudo passwd<\/pre>\nChange a users’ primary group<\/h2>\n
usermod -g<\/pre>\nAdd a group<\/h2>\n
groupadd<\/pre>\nAdd a user to a group<\/h2>\n
usermod -G<\/pre>\nMake everything in a dir owned by the dir group owner<\/h2>\n
sudo chmod g+s<\/pre>\nFind largest 10 files in wp-content folder<\/h2>\n
find wp-content -type f -exec du -h {} + | sort -rh | head -n 10<\/pre>\n\n\n\n<\/pre>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_genesis_hide_title":false,"_genesis_hide_breadcrumbs":false,"_genesis_hide_singular_image":false,"_genesis_hide_footer_widgets":false,"_genesis_custom_body_class":"","_genesis_custom_post_class":"","_genesis_layout":"","footnotes":""},"categories":[6],"tags":[9,43],"yoast_head":"\nUseful Linux Commands - My Monkey Do<\/title>\n\n\n\n\n\n\n\n\n\n\n\n\n\t\n\t\n\t\n