0
votes
1answer
42 views

What causes “bash: /bin: Is a directory” every time a terminal is opened? [closed]

This is initial screen I am getting on Ubuntu 12.04, when I open a terminal (Ctrl+Alt+T): That is, the text on the terminal is: bash: /bin: Is a directory chase@chase-desktop:~$ gedit ~/.bashrc ...
3
votes
1answer
38 views

How to periodically back up a folder on change?

I want to achieve the following functionality in ubuntu but I dont know how to do it. I need a daemon that periodically backs up a directory, say dir to another location by doing the following: ...
1
vote
4answers
74 views

Change directory structure from /YEAR/MONTH/DAY/ to /YEAR-MONTH-DAY

I need to change my directory structure for my photos from /YEAR/MONTH/DAY/ to /YEAR-MONTH-DAY I know this can sort of be done with exiftool, but it will only work on files containing EXIF-tags, and ...
0
votes
4answers
199 views

How to access/delete a folder accidentally named with escaped characters? [duplicate]

I was setting up a cloud server and saw that I accidentally added a folder named ^[[4~ (with escape code). I want to see what is inside and if that was just a mistake then remove that directory. ...
2
votes
1answer
1k views

Find USB device's directory /sys/bus/usb/devices/ using idVendor/idProduct

I'm trying to make a script that takes the product and vendor id printed by using lsusb, then checking against this ID to find the USB device's directory in /sys/bus/usb/devices. I initially thought ...
2
votes
3answers
142 views

How to navigate through directories named with non-latin characters?

I just don't know if it's possible and how to cd for example in a dir that is not named with latin characters. Example: $ cd άλφα or $ cd альфа Update: In a terminal it is ok, but in a CLI ...
0
votes
1answer
115 views

Why does the script list directories starting with uppercase first, and all-lowercase second?

The thread is an extension of: Basic script listing directories ([: discover: unexpected operator) When I execute the script: for item in * do if [ -d "$item" ] then echo "$item" fi ...
1
vote
2answers
301 views

Basic script listing directories ([: discover: unexpected operator)

I encounter an issue running a basic script listing directories. for item in * do if [ -d $item ] then echo $item fi done The outcome: lists all system folders returns an error: ...
4
votes
2answers
124 views

Using popd without removing last value

How can I get the behavior of using popd without actually popping the last directory off of the stack? In other words, I want to navigate back to the last directory that I set with pushd, but I want ...
4
votes
3answers
571 views

Going to the parent directory of a file with cd?

I am writing a .sh to do some work for me, but I am now at the point where I have to cd to the directory the file /path/to/file.end is in. terminal doesn't allow cd /path/to/file.end bash: cd: ...
2
votes
1answer
167 views

Automatically cd into directories?

In the terminal You use cd ../../........ to get to wherever you want, But I am lazy, I am wondering if it is possible to automatically cd into the directories if the command is simply the directory. ...
0
votes
2answers
218 views

Flatten directory with incrementing names

i need a bash script for flattern a directory with same names, and get an ordered output after a conversion. input folder structure: /in1/file1.wav /in1/file2.wav /in1/file3.wav /in2/file1.wav ...
2
votes
1answer
116 views

What is the best directory for script files?

I have my own shell script files and I want to run them in terminal, keeping them in /usr/bin folder. But my question is: which directory is best for keeping files of my own script? I want to use this ...
5
votes
2answers
3k views

How to protecting cd command to deal with parentheses?

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 ...
6
votes
2answers
482 views

How to 'cd' to a directory found with 'find'?

I have a file in gmai.rb in the below directory: root@ubuntu:~# find / -name gmail.rb|more /media/aruprakshit/FA686DE4686DA05D/Rubyscript/gmail.rb But when i am trying to reach to the Rubyscript ...
8
votes
2answers
638 views

What does the l command do?

There is a command l available on my machine which appears to do nothing. which l also produces no output. Is this a real command, and does it actually do anything?
2
votes
3answers
4k views

Why does `cd downloads` fail with “No such file or directory”?

Running Ubuntu 12.04, while in a terminal, I type ls and see list of folders, including the downloads folder. I then type cd downloads, press enter. I get bash: cd: downloads: No such file or ...
2
votes
1answer
133 views

Is there a way to alias the command cd so that it protects the arguments?

When I run cd My folder There is an error because I have not protected the string. bash: cd: My: No such file or directory But this works fine cd "My folder" Is there a way to redefine cd as an ...
2
votes
6answers
1k views

climb up the directory tree faster

if I'm in a very deep directory a/b/c/d/e/f/g/h/i/j and want to come back a/b/c, I have to use ../../../../../../../. Is there command I can pass through a number, e.g. cd up 7, to speed this ...
2
votes
1answer
7k views

How to unzip files into the current directory?

I am trying to write a bash script that will automatically unzip mp3 downloads and move them into my ~/music folder. My problem is that when I use the unzip command, it creates it's own folder ...
2
votes
3answers
11k views

Desktop directory not opening

I am completely new to Ubuntu or any distribution of linux altogether. While using the terminal, when i am in the /home/username directory the ls command shows Desktop and Download directories but the ...
6
votes
1answer
14k views

Find file or directory in whole directory structure

How can I find a file with a specific name in bash. I want to search through the whole system. I tried with find, but that only work through one level.
0
votes
3answers
2k views

How to change directory at the end of a bash script?

In my .bashrc: function rnew { $HOME/.dotfiles/railsnewapp.sh $1; } Essentially, I call rnew from any directory, and it creates a directory in ~/code/appname, installs Rails into it, and then I ...
0
votes
1answer
207 views

Is there a better (closer to home row on keyboard) shortcut for the home directory in bash than tilde?

I don't like reaching for the tilde ~ key so often when I'm specifying file and program paths relative to the user home directory on the command line. Does anyone have any tips for cutting the number ...