Tag Archives: linux

Changing username on centos linux

Let’s say I have the username of tom and my main group is also tom.

For some reason I now need my username to be jerry and in the group jerry.

sudo usermod -l jerry tom

That changed the username from tom to jerry. But jerry is still in the group tom.

sudo groupmod -n jerry tom

Okay. Now jerry is in the group jerry. But all jerry’s files are still in /home/tom.

sudo usermod -m -d /home/jerry jerry

Voila! Now tom is jerry.

make an ntfs formatted usb drive with a label

For some reason, I found it difficult to find the answer as to how I could take an USB thumb drive, format it with the NTFS file system, and label it. All from the command line and on Linux. After Googling, Duck Duck Go-ing it, and searching with Qwant I remembered that I have a handy little program installed called tldr.

tldr mkfs.ntfs

One of the results was the following:

  • Create filesystem with a volume-label: mkfs.ntfs -L {{volume_label}} {{/dev/sdb1}}

So first of all I needed to find the right device name for the thumb drive I had plugged in so I didn’t overwrite my 200 gigabyte home folder!

sdc               8:32   1   7.6G  0 disk  
└─sdc1            8:33   1   7.6G  0 part

Now that I had the right device to write to, I could create a file system on it.

sudo mkfs.ntfs /dev/sdc1 -L "THE WALKING DEAD"

Bingo! That did the trick.