Scenario:- What are some of basic commands one should know when moving from windows enviornment to linux(say ubuntu)?
1.Sudo(Run as adminstator in windows) – sudo command executes a command with administrative privileges (root-user administrative level), which is necessary
example sudo mkdir test
2.mkdir(new folder), creates new working directory in the selected location
3.pwd, tells the current working directory
4. ls, list all the files in the given folder
5.ll, another form of listing the items try it out
6.Editing a file :-
- Open file sudo vi filename
- press ESC
- press i (for inserting values into file)
- move cursor the position where editing need to be done
- type :wq (to write and quit the file after saving)
13.Launch background screen when remote into linux box using ssh
For example we used ssh userName@IP to remote into linux box, now we want to run an new terminal instance apart from the login window instance. We can use “screen -R Name” command to achieve this.
a)We can shift to main terminal by “CTRL+SHIFT+A” than press “D”.
b) Move back to secondary terminal any time even our original session is broken by screen -R terminalName
c)list all the present screens, screen -ls
d)kill the instance of screen
screen -X -S screenId kill
14.How to move directory from local machine to remote machine?
Using secure copy command as below
scp -r ./localpath remoteuser@remoteIP(10.0.0.34):/home/remotepath
-r means recursive copy
15.How to check the file system size in human readable form?
16. How to search a given file in all the computer directories?
find / | grep filename
17. Check that given process is running?
ps ax | grep processname
18.Open the big file to show only last 100 lines?
tail -n 100 filename
19.Open a given file showing the updated view each time when new content is appended?
tail -f filename
20. Download code or file directly from given server?
21.Change file permission for folder for given user?
chown userName -R folderName