LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-12-2016, 03:08 AM   #1
sigint-ninja
Member
 
Registered: Feb 2011
Location: Republic Of Ireland
Distribution: Debian,Centos,Slackware
Posts: 508

Rep: Reputation: 29
what does cd \ do at the command line


only noticed now when you type
cd\ or cd \ ....it gives you a
>

what is this function?

tried google didnt show anything about cd\
 
Old 12-12-2016, 03:31 AM   #2
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,533
Blog Entries: 4

Rep: Reputation: 3832Reputation: 3832Reputation: 3832Reputation: 3832Reputation: 3832Reputation: 3832Reputation: 3832Reputation: 3832Reputation: 3832Reputation: 3832Reputation: 3832
The backslash escapes the following character. If you do it at the end of a line, it tells the interface that things will continue on the next line. In the case of either a script or an interactive shell, you can do that to make what you are doing more readable.

So specifically with "cd" you are giving it "cd" and then telling it to hang on and wait for whatever you are going to type on the next line.

Edit: Here's an example firing up "qemu" over several lines:

Code:
qemu-system-x86_64 -boot c -redir tcp:2227::22 -redir tcp:4777::80 \
        -netdev user,id=network0 -device e1000,netdev=network0 -m 1024m \
        -enable-kvm -cdrom ~/Torrents/CentOS-7-x86_64-DVD-1511/CentOS-7-x86_64-DVD-1511.iso \
        ~/tmp/centos-7-desk.img

Last edited by Turbocapitalist; 12-12-2016 at 03:34 AM.
 
1 members found this post helpful.
Old 12-12-2016, 03:46 AM   #3
Shadow_7
Senior Member
 
Registered: Feb 2003
Distribution: debian
Posts: 4,137
Blog Entries: 1

Rep: Reputation: 875Reputation: 875Reputation: 875Reputation: 875Reputation: 875Reputation: 875Reputation: 875
The \ is a line continuation character (or escape character). So the > is the prompt to finish the line. Versus / that is a path character.

Code:
$ echo -e " ""\x48""\x45""\x4c""\x4c""\x4f"
is roughly the same as:

Code:
$ echo -e \
> "\x48"\
> "\x45"\
> "\x4c"\
> "\x4c"\
> "\x4f"
 
1 members found this post helpful.
Old 12-12-2016, 03:53 AM   #4
Shadow_7
Senior Member
 
Registered: Feb 2003
Distribution: debian
Posts: 4,137
Blog Entries: 1

Rep: Reputation: 875Reputation: 875Reputation: 875Reputation: 875Reputation: 875Reputation: 875Reputation: 875
Also, using \ before a command tells it to ignore any alias that might be set for the command.

$ \ls

Where just ls is probably aliased to pass parms that uses colors.
 
Old 12-13-2016, 02:42 PM   #5
Fat_Elvis
Member
 
Registered: Oct 2016
Distribution: Slackware
Posts: 310

Rep: Reputation: 93
Oh boy, that's actually a very difficult thing to explain if you don't have experience with how escape characters work.

Were you, by any chance trying to go to the root directory? In which case:

Quote:
cd /
should be what you are looking for.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Cursor does not move to the bottom line and overwrite to same line on command line mesuutt Linux - Newbie 3 02-25-2012 08:04 AM
Print all PID folders from /proc line-by-line with this format (( PID: command-line )) courteous Linux - Newbie 7 12-12-2010 04:47 PM
awk command line: blank line record sep, new line field sep robertmarkbram Programming 4 02-21-2010 05:25 AM
xine command line? or some other command line only engine? lumix Linux - Software 2 08-10-2007 10:46 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:45 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration