How to view profile on Linux

I'm trying to do this part of my assessment:
Show and explain the contents of the profile file.

But I cannot open it. I tried ls- profil, but that didn't work.

Edit: Melebius helped me to find the answer. Thanks dude!

8

1 Answer

The correct filename of the current user’s profile is ~/.profile (where ~ is a shortcut for the current user’s home directory).

You can use the command cat to just print the file out:

cat ~/.profile

For long files, the file viewer less can come in handy:

less ~/.profile

(Press q to quit less.)

Of course, you can open the file using your favorite editor, e.g. vi (a command-line based editor) or gedit (the default GUI text editor in Ubuntu) to view (and modify) it.

vi ~/.profile
gedit ~/.profile

(Type :q Enter to quit vi.)

1

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like