Thursday, 10 March 2016

Linux

Linux Basic Commands :

  • uname -a  : Gives us OS information.

IBX AIX :
vi : Esc + x - to delete data
vi : Esc + I  - insert data

  • chmod 777 <file/directory>
0 – no permission
1 – execute
2 – write
3 – write and execute
4 – read
5 – read and execute
6 – read and write
7 – read, write, and execute

  • sudo - super user do - Sue dough
 Have you ever tried to run a command in terminal only to be given “Access Denied?”  Well this is the command for you!  But, with great power comes great responsibility!  It is much better than logging in as root, or using the su “switch user” command.

sudo –b will run the command in the background.  This is useful for commands that display a lot of output as they are running.
sudo –s will run the shell specified with elevated privlages, giving you the # prompt (don’t forget to exit!)
sudo su – will make you the root user and load your custom user environment variables.

https://linuxacademy.com/blog/linux/linux-commands-for-beginners-sudo/

  • ps -ef | grep <processName>
  • ps aux | grep <processName>
To run a file having different user priviliges:
sudo su -c "sh elasticsearch" -s /bin/sh aneela1
sudo -b su -c "sh elasticsearch" -s /bin/sh aneela1  - to run it background
sudo -b su -c "sh kibana" -s /bin/sh aneela1

something.sh -d -p pid    -to run a process as demon
ls -ltr | wc -l    -to see no of files existing

No comments:

Post a Comment