Find the current user UID and GID
Answer:
Use the id command
E.g. check the UID and GID of the user - "mysql"
# id mysql
uid=106(mysql) gid=111(mysql) groups=111(mysql)
Linux Ask! is a Q & A web site specific for Linux related questions. Questions are collected, answered and audited by experienced Linux users.
Find the current user UID and GID
Answer:
Use the id command
E.g. check the UID and GID of the user - "mysql"
# id mysql
uid=106(mysql) gid=111(mysql) groups=111(mysql)
How to change the default runlevel?
Answer:
For example, you want to change the runlevel from GUI mode to console mode
Edit the file /etc/inittab, change the following line
id:5:initdefault
Change the number from 5 to 3.
For more information about runlevel, see: http://en.wikipedia.org/wiki/Runlevel
How to grep a string in a binary file?
Answer:
Assume you have a binary file "foo.bin", you can combine strings with the grep command.
strings foo.bin | grep bar
How to find the differences between two files over SSH
Answer:
If the files you want to compare are on different machines, you can combine ssh and diff for the comparsion.
E.g.
ssh [email protected] "cat /tmp/foo.txt" | diff - /tmp/bar.txt
How to find the differences between two files
Answer:
Use the diff command
E.g.
diff foo.txt bar.txt