Shellscript command cd

Asked

Viewed 298 times

1

Which command do I use to go straight to folder login without having to put my name example cd home/leonardovillela.?

  • the command is the same, but has a shortcut to home folder: cd ~

  • @Bacco, if you want to answer the question let me know, I ended up posting an answer but I didn’t see your comment.

  • @Wakim did not post as an answer because he thinks it is not a question in the scope of the site, and this kind of thing I think fits more as a comment anyway. Anyway, thank you for asking.

  • 2

    @Bacco, in my opinion is within the scope yes, shell-script is a programming language... as well as doubts related to files batch are within the scope, I believe shell-script also (http://meta.pt.stackoverflow.com/questions/1266/cria%C3%A7%C3%A3o-de-arquivo-bat-entra-no-escopo-do-sopt).

  • 2

    For me the mere command syntax query is not a shell-script question, regardless of where the command will be used (but it is perfectly valid your opinion to be different, after all we are in community ;) ).

1 answer

1


Just use the command cd ~, with it you will go to the directory home of the current user.

  • 2

    Other forms would be: just cd and cd $HOME.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.