DEV Community

Cover image for Linux Commands Part 1:
MuthuKumar
MuthuKumar

Posted on • Edited on

Linux Commands Part 1:

fmt command:

$ cat > fmt.txt
hai
all welcome
to
ILUGC

$ cat fmt.txt
hai
all welcome
to
ILUGC

$ fmt fmt.txt
hai all welcome to ILUGC

Image description

hostname:

$ hostname
localmachine

Image description
$ hostname -I
192.168.1.100 192.168.122.1 172.17.0.1

Image description

$ sudo hostname <new_hostname>
Example:
$ sudo hostname host
1.
Image description

2.

  • Enter the Password:

Image description

  • close the terminal and again open the terminal:

the hostname has been changed

Image description

to set the host as hostname
$ sudo hostname host

  • 1.
    Image description

  • 2.
    Image description

locate command:

  • find the file name quickly

$ sudo updatedb

once created the file after update db using below mention the command

Image description

$ locate fmt.txt
/home/muthukumar/fmt.txt

Image description

  • i have created the one text file name of secret and then using locate secret.txt and hit the enter but location is not showing in my terminal why ? ..not showing in the location because in this file not update in the db . so you have used this command sudo updatedb then next you have using the command and check secret.txt Result Showing:

Image description

AWS GenAI LIVE image

Real challenges. Real solutions. Real talk.

From technical discussions to philosophical debates, AWS and AWS Partners examine the impact and evolution of gen AI.

Learn more

Top comments (0)

Billboard image

Create up to 10 Postgres Databases on Neon's free plan.

If you're starting a new project, Neon has got your databases covered. No credit cards. No trials. No getting in your way.

Try Neon for Free →

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay