Linked Questions

35
votes
4answers
492k views

How to write the path of a folder with space in its name? [duplicate]

I can't figure out how to write the path of a folder that includes spaces in its name (in Terminal). I tried: cd /path/path/path/"A Folder"/file cd /path/path/path/'A Folder/file cd /path/path/...
30
votes
2answers
171k views

How do I navigate to folders with spaces in their names? I get “no such file or directory” when I try [duplicate]

I'm completely new and lost in Ubuntu 12.04, I'm having trouble navigating to my Sublime folder which I know is in my /opt folder. Yet I've tried to no avail to navigate into it via Terminal window. ...
12
votes
5answers
2k views

Using cd command to navigate directories in Ubuntu which have special characters [duplicate]

When I want to navigate into directories having special characters in their names I get an error message. For example: aman@desktop:~/Aman$ cd !)e$!gn&(reate bash: !: event not found aman@...
21
votes
2answers
40k views

How can I protect parentheses passed to a cd command? [duplicate]

I asked here how to make cd protect spaces. Tab completion is great, but sometimes you paste the path from the clipboard so this is useful. The solution breaks with parentheses however. No matter how ...
9
votes
2answers
54k views

How to access files/directories with spaces in the name? [duplicate]

Through terminal I can't access files or directories with a spaces in their names. The cd command says no such file or directory. Is there any way to do it or should I rename all files with spaces?
9
votes
2answers
759 views

using '&' in a directory name [duplicate]

i have a directory name with ISO&Emulator having some Important Files. and this directory is in different partition, and partition not showing in my FileManager(Nautilus). so i mount my partition ...
2
votes
3answers
728 views

How can I enter and also rename folders like ''Human (2012)''? [duplicate]

I am playing with FTP via the command line, and I get two problems. I am not able to rename or enter folders like: dir /home/folder1/Human (2012) I tried: cd ~/folder1/Human\ (2012) Here I receive ...
5
votes
2answers
361 views

Dealing with space in file links using bash [duplicate]

I got a problem. Here is my bash script to merge videos with subs: #!/bin/bash cd /media/ptrknvk/'TOSHIBA EXT'/Shows/My/'Doctor Who'/ url0='DW s11e0' url1='DW\ s11e' for(( i=1; i<11; i++ )) do ...
2
votes
2answers
898 views

cd to a directory has hash (#) [duplicate]

Well, I have few directories have name contains hashes (#, eg: #abczxy). Now I can't to execute this cd #foo it will redirect me back to the root directory equal with this command cd The question is, ...
2
votes
1answer
17k views

cp: cannot stat: No such file or directory exists [duplicate]

Orienting myself with basic terminal commands (Ubuntu 16.04); I have a file listed in my Downloads folder; a Jupyter notebook file called, 'Indexing and Slicing.ipynb' and wish to copy the file to my ...
3
votes
2answers
3k views

unzip unable to find file with spaces in file name [duplicate]

I'm a psychology student at the VU Amsterdam. For my statistic courses this software called IBM SPSS statistics is required andabsolutly neccesary. I bought it of the official website and downloaded ...
0
votes
1answer
3k views

How can I change directory on bash on Ubuntu on windows? [duplicate]

I cannot change directory like this I have a problem like this:
3
votes
1answer
2k views

“cd” into directory containg space in name [duplicate]

So I have been using Ubuntu for a few months now, and have come across a very noob terminal question. I want to go from home -> Documents -> My Programs I am able to get into my documents folder by ...
14
votes
0answers
3k views

How do I enter a file or directory name containing spaces or special characters in the terminal? [duplicate]

I have a collection of files and directories with strange names, they contain spaces and the special characters \, *, ), ( and ?. All of them cause problems when I try to use them in the command line ...
0
votes
1answer
1k views

Escape $ in password [duplicate]

How should I escape special characters in bash flyway info -url="jdbc:redshift://server_name/db_name?ssl=true&sslfactory=com.amazon.redshift.ssl.NonValidatingFactory" -password='$PROD_PASSWORD' ...
0
votes
2answers
78 views

Why does Ubuntu split up my file path? [duplicate]

I had a small question concerning something in Ubuntu. I noticed that whenever I cd to a two-word place, Ubuntu seems to go there. However, when I mention the file path to this place, Ubuntu splits up ...
0
votes
0answers
609 views

How to pass a stored bash variable to a wget url [duplicate]

I am trying to pass a variable stored in shell script and when It runs the wget command it only returns the website without the variables being passed below is the code I have for the shell script ip=...
1
vote
2answers
82 views

How do I delete file named -?]d?j??.? from system? [duplicate]

I cannot remove such file, I get error message. file name is -?]d?j??.? and I want to remove it. I try rm -?]d?j??.? but it gives error.
0
votes
1answer
96 views

Help with deleting files and folders [duplicate]

I am using Ubuntu 16.04lts, I am trying to get rid of a couple of folders. I have tried what I thought to be the correct method, but they seem to fail. $ ls -la total 32 drwxrwxr-x 6 rod rod 4096 ...
-1
votes
1answer
53 views

How to edit a file that has a space in its name? [duplicate]

I'm on Ubuntu 18.04. If I go into my home directory and right-click and select "new document" and then "empty document", a new file appears called "Untitled Document". Now I want to edit what's in ...
0
votes
0answers
46 views

How to open a directory with spaces in its name from the terminal? [duplicate]

Possible Duplicate: How do I change directory to a folder with special characters? I am trying to open dir in Terminator, but when I want to open dir that consists of two or more words I get ...
0
votes
0answers
19 views

folder navigation [duplicate]

I am having a problem trying to install Microchip's MPLAB X IDE under a newly downloaded install of Ubuntu 18. I don't know if its a problem caused by the command line example given by microchip, or ...
0
votes
0answers
16 views

Cannot compile a c++ file on Ubuntu if the filename containes brackets [duplicate]

I ran into this weird error /bin/bash: -c: line 0: syntax error near unexpected token `(' /bin/bash: -c: line 0: `g++ -g 54.Array(300A).cpp -o 54.Array(300A)' The program compiles if I change the ...
19
votes
9answers
3k views

Open a doc from terminal, but not by its name

Is it possible to open a file from the terminal not by its name but by its (number) position in the folder? Or any other option? Because the name is too long.
34
votes
5answers
37k views

How can I convert audio from ogg to mp3?

I'm looking for a well working audio converter which is able to convert audio files (ogg) to mp3 formate. I tried it with the "sound converter" from software center but it stopped converting after 6 ...
8
votes
4answers
3k views

Is there a way to create a script and make it executable in less code than this?

My code to create an executable script touch script.sh && echo "echo 'Hello World'" > script.sh && sudo chmod +x script.sh
6
votes
6answers
2k views

How to move files from subdirectories that have the same directory name to its relative upper/parent directory?

So, I have a directory structure like this: parent/ ├── sub1 │   └── source │   └── file1 │ └── file2 ├── sub2 │   └── sub2.1 │   └── source │   └── something1 │ └── ...
2
votes
2answers
6k views

“chmod: missing operand” while installing tomcat 7 on Ubuntu 18.04

~/tomcat/apache-tomcat-7.0.90/bin$ sudo chmod 700/tomcat/apache-tomcat-7.0.90/bin/*.sh chmod: missing operand after ‘700/tomcat/apache-tomcat-7.0.90/bin/*.sh’ I am not able to understand this error. ...
5
votes
2answers
451 views

How to rename (unhide) all files and subdirectories within a directory?

I want to make a script to "unhide" all files and directories inside a certain directory in one go, e.g. ./unhide test. test/ ├── sub1 │   └── .hiddenfile1 └── sub2 └── .hiddendir ├── ....
3
votes
3answers
639 views

Replace String “Development” with “Staging” or “Production” using SED

I am trying to replace the string : 'development' with : 'production' using sed. I tried a few options including: sed -i "s|: \'development\'|: \'staging\'|g" index.php but without any luck. ...
2
votes
2answers
165 views

How to send output of convert to a writable directory in bash?

I want to convert .tbl files to .csv in /data/ directory which I've got read-only access. I'm using this command: for i in `ls *.tbl`; do sed 's/|$//' $i > ${i/tbl/csv} echo $i done But I'...
1
vote
1answer
657 views

In a bash script how do I pass a variable integer to a 'sed -e' command (18.04)

I'm trying to create a bash script that trashes the oldest files in a directory with a variable setting the amount of files to retain. My first step was to count the number of files older than a set ...
2
votes
2answers
130 views

single quote and double quotes in sed

I tested the single quote and double quotes in sed me@host:~: $ echo "front" | sed "s/front/back/" back me@host:~: $ echo "front" | sed 's/front/back/' back They performed identically, but I ...
3
votes
2answers
148 views

How to run commands in the shell in parallel without disrupting the output?

I have the following shell script: ./run 50 5000 100 100 1.0 2 0.3 0.3 0.05 1 101 0 2 1 0 10 0.1 & ./run 50 5000 100 100 1.0 2 0.3 0.3 0.05 1 101 0 2 1 0 10 0.2 & ./run 50 5000 100 100 1.0 2 ...
3
votes
1answer
85 views

Trying to create a folder with date and time with a space

I am trying to create the folder using: mkdir $(date +%Y-%m-%d %H%M) So you see a space between the two and I know this is not best practice but I would like to get it to work. I have tried to ...
2
votes
2answers
98 views

Using SED to delete text in a file

I am trying to create a bash script that will manage a basic inventory system for a friend. Everything he wants to inventory has a barcode, that when scanned, returns a 6 digit number (EX. 000001). I ...
3
votes
1answer
89 views

How to send JSON as variable with bash curl?

I'm trying to send a POST request with curl, but I'd like to store the json data in a variable in order to resend it if an error occur. I used this code: jsonvariable="{"ora" : "value1", "temp" : "...
1
vote
1answer
80 views

auto edit a text file

first let me say I have been teaching myself Linux, and I am not "techie" knowledgeable yet. I am using Ubuntu 18.04 and find myself using the BASH to create files I can run. One thing I am trying ...
-1
votes
1answer
78 views

Using “” in shellscript

i need to use a ffmpeg command in a shellscript The command is the next one (ffmpeg -hide_banner -hwaccel cuvid -c:v h264_cuvid -f hls -i $(youtube-dl -f 95 -g $ylink) -c:v h264_nvenc -r 50 -c:a ...
0
votes
1answer
74 views

File's order got destroyed while grepping and echoing into for loop

I want to write the result of grep inside for loop into a file, keeping original file structure. Original file: $cat newtest1 some_text /homes/myself/joz ivan petrov - 20/10/19 new customer: /homes/...
0
votes
1answer
75 views

How to reset the admin password on Ubuntu 12.04 if the username has a space [duplicate]

I'm having difficulties resetting admin password on my Ubuntu 12.04 if the username has a space eg. Buggs Bunny? At the prompt it will only display Buggs and wont allow the password command to work
1
vote
1answer
65 views

Can you quote a random string without knowing if it contains special characters?

I'm having trouble inputting random generated passwords into some scripts. I generate the password, and paste it between "". But sometimes it contains characters that sends the whole thing crashing ...