Tag: unix


Jump to end of file with vi or vim | Jump to last line

Insert Mode is when you have a block cursor and can edit the text Command Mode is when you have a : at the bottom where you can enter commands. If you are in insert mode or command mode hit: escape key then shift+g keys If you are not in insert mode...

Add an existing user to an existing group in Linux

If you want to a add a user to an existing group this is how you do it. [local_username@localhost /]$ useradd -a -G somegroup usernameThen log out and log back in for the new group settings to take effect.Managing permissions for a group is an importan...

Only list files | don't list directories | "find" command in Linux

How to: Find all files under a directory Find only files from the command line in Linux Don't search for directories [user@machinename ~]$ find /some/directory -type f -name filename Replace "/some/directory" with your directory "-type f" means on...

Check if a database exists in MySQL from the command line

To check if a database exists from the command line in MySQL echo the following query and pipe (|) it to the MySQL command line utility:echo SELECT COUNT(*) as num FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMATA.SCHEMA_NAME="some_database_name"; | mys...

Find a file by name in Linux and don't show permission denied

Looks for a file named "game" starting at the root directory (searching all directories including mounted filesystems). The `-name' option makes the search case sensitive. You can use the `-iname' option to find something regardless of case. find / -...