Labels

Tuesday, November 22, 2011

How to change user's home directory and user name, and delete user and all files in Ubuntu

1. To change the user's home directory
sudo usermod -d /path/of/new/home -m username

will copy all files from user's home directory to /path/to/new/home and will also update the system file that stores the location of user's home directory (/etc/passwd).


2. to change the username (used as username in the system) and the user’s real name (usually is a displayed name).

sudo usermod -c "Real Name" -l New_Username Old_Username


3. Deleting a User from an Ubuntu Linux System

3.1 An existing user may be deleted using the same User settings dialog used to add a user as outlined above. Select the System desktop menu and choose Users and Groups from the Administration sub-menu to launch the User settings dialog.

Select the user to be deleted and click on Delete. A confirmation dialog will appear. If you wish to proceed click on Delete in the confirmation dialog to commit the change.

Note that the deletion process will remove the account but leave the user's home directory intact. This will need to be deleted manually if it, and any files therein, are no longer required.


3.2 A user account may also be deleted from command-line using the deluser utility:

sudo deluser john


3.3 It is also possible to remove the user's home directory as part of the deletion process:

sudo deluser --remove-home john

Alternatively all files owned by the user, including those in the user's home directory may be removed as follows:

sudo deluser --remove-all-files john

The files in the user's home directory can also be backed up to another location before the directory is deleted using --backup-to command-line option together with the path to the backup directory:

sudo deluser --backup-to /oldusers/backups/john --remove-home john

Ubuntu: How to Change the Computer Name

gksudo gedit /etc/hostname

1.When prompted, enter the administrator password and click the OK button.
2. The hostname file will open, displaying the current computer name. Replace the current computer name with the desired new name.
3. Click Save. 6. Close all open windows and restart your system.
After your system has restarted, it will have the new computer name.

From:
http://www.tech-recipes.com/rx/2732/ubuntu_how_to_change_computer_name/

Wednesday, November 16, 2011

Command--pwd and cd

Or print working directory using pwd command

[prompt]$ pwd

/home/dliu

cd Command

cd ..  or s go back one directory, .. directory corresponds to the parent directory

cd or cd ~   go back to home directory

cd /             moves to root

cd -  go back to one directory previously used like backward in windows explore     

Tuesday, November 15, 2011

Where is the Trash box

~/.local/share/Trash
The trash can icon on the desktop contains files and folders which you have deleted using the File Manager or an application run from the desktop. It doesn't keep the deleted file from a terminal.

Monday, November 14, 2011

Compare two different versions of a source file

original link: http://justinram.wordpress.com/2006/04/26/windows-subversion-tortoisesvn-compare-two-versions-of-a-file/
Today I needed to compare two different versions of a source file. One in the main trunk folder and the other in a previously tagged version folder. This is easily done in TortoiseSVN, snippet from the TortoiseSVN manual:
Compare two revisions of a file
If you want to compare two revisions in a file’s history, for example revisions 100 and 200 of the same file, just use TortoiseSVN => Show Log to list the revision history for that file. Pick the two revisions you want to compare then use Context Menu => Compare Revisions.
If you want to compare the same file in two different trees, for example the trunk and a branch, you can use the repository browser to open up both trees, select the file in both places, then use Context Menu => Compare Revisions.
If you want to compare two trees to see what has changed, for example the trunk and a tagged release, you can use TortoiseSVN => Revision Graph Select the two nodes to compare, then use Context Menu => Compare HEAD Revisions. This will show a list of changed files, and you can then select individual files to view the changes in detail. Alternatively use Context Menu => Unified Diff of HEAD Revisions to see a summary of all differences, with minimal context.
The process of comparing two trees is really nicely done, you get a list of all the files which have been changed between the two trees. You can then drill into this list and see the changes made to individual files.

Checked out revision number in Tortoise SVN?

Right-click on the working directory in windows explorer, and select "Properties", not the "Properties" inside the menu of "tortoiseSVN". You will see the Properties dialog, which will have a tab called "Subversion". Click on it, and you will see the version number, and other info.