I recently started working on AWS ubuntu and trying to revive my linux command knowledge 🙂
Posting some basic commands that we will come across while handling Ubuntu on AWS
service httpd start
Edit Apache Config file
Install Mod rewrite
sudo a2enmod rewrite
Default Apache ROOT directory
Copy Content/files of One Folder into another
cp -r wordpress/* /my/folder
Delete a file
To Start vi
- To use vi on a file, type in vi filename. If the file named filename exists, then the first page (or screen) of the file will be displayed; if the file does not exist, then an empty file and screen are created into which you may enter text.
|*||vi filename||edit filename starting at line 1|
|vi -r filename||recover filename that was being edited when system crashed|
To Exit vi
- Usually the new or modified file is saved when you leave vi. However, it is also possible to quit viwithout saving the file.
- Note: The cursor moves to bottom of screen whenever a colon (:) is typed. This type of command is completed by hitting the <Return> (or <Enter>) key.
|*||😡<Return>||quit vi, writing out modified file to file named in original invocation|
|:wq<Return>||quit vi, writing out modified file to file named in original invocation|
|:q<Return>||quit (or exit) vi|
|*||:q!<Return>||quit vi even though latest changes have not been saved for this vi call|