Hot answers tagged

67

Short answer mkdir takes multiple arguments, simply run mkdir dir_1 dir_2


54

You can use lists to create directories and it can get pretty wild. Same examples to get people thinking about it: mkdir sa{1..50} mkdir -p sa{1..50}/sax{1..50} mkdir {a-z}12345 mkdir {1,2,3} mkdir test{01..10} mkdir -p `date '+%y%m%d'`/{1,2,3} mkdir -p $USER/{1,2,3} 50 directories from sa1 through sa50 same but each of the directories will hold 50 ...


8

Use the -p option of mkdir: mkdir -p ~/test/panda/fat From man mkdir: -p, --parents no error if existing, make parent directories as needed Example: % mkdir /tmp/foo/bar mkdir: cannot create directory ‘/tmp/foo/bar’: No such file or directory % mkdir -p /tmp/foo/bar ## Done Now about a file creation after automatically creating ...


7

There are three ways I'd consider doing this. Hacky and error-fuelled, "MOVE ALL THE THINGS" mv ~/MYDIR/* ~/MYDIR/DESTINATIONDIR This will try to move the destination into itself and will explode: mv: cannot move ‘~/MYDIR/DESTINATIONDIR’ to a subdirectory of itself, ‘~/MYDIR/DESTINATIONDIR/DESTINATIONDIR’ But it will move [almost] everything else. So ...


6

Something like this? (thanks to muru for the printf tip) printf '%s' 'foo,bar,baz' | xargs -d, mkdir $ ls $ printf '%s' 'foo,bar,baz' | xargs -d, mkdir $ ls bar baz foo $ You can wrap it into a function for ease of use: function mkdir_cs { printf '%s' "$1" | xargs -d, mkdir } $ ls $ mkdir_cs 'foo,bar,baz' $ ls bar baz foo $


5

So you want comma separated list of directory names ? That can be done. Shell + coreutils Since everybody is posting oneliners, here's mine as well ( mkdir + parameter substitution plus + shell redirection ). DIR:/testdir skolodya@ubuntu:$ ls DIR:/testdir skolodya@ubuntu:$ mkdir $( tr '[,\n]' ' ' < /home/xieerqi/dirList.txt ) ...


3

Yes, you can create Bookmarks. Just go inside the folder you want to bookmark and select Bookmark this location in the Bookmarks section of the top panel. Or use Ctrl + D keyboard shortcut.


3

Make a list of the names for your desired directories using line breaks instead of commas as a separator. Save that list. mkdir `cat list` You should now have all the directories named in your list.


2

The problem here is that the way users are authenticated for login on Ubuntu is with the /etc/passwd file. Since that file is missing... bad things are going to happen, such as sudo not working. If you have root access somewhere, such as a session you still have open, or you can figure out how to get in as root, you can make a symlink (which is similar to a ...


2

All you need is to run the hl.exe with "-game hlspbunny" parameter, so you can do this in the command line (Ctrl + Alt + t): LINK_OF_THE_HL_DIR/hl.exe -game hlspbunny And it can be converted into a script, save the following content into a file, e.g. HL-mod.sh: #!/bin/sh LINK_OF_THE_HL_DIR/hl.exe -game hlspbunny Remember to change the ...


2

Are the parenthesis in the question literally in your command? If so, they are the cause of your problems. If you must have them, then escape them as *\(disc3\)* and it should work. This happens because the shell is interpreting the parentheses and not using them as part of your text.


2

This isn't an Ubuntu problem but a Microsoft problem. As you said, your external hard drive is formatted with NTFS which means that you're not as free to choose your file names as you are when using ext. You can't use any of these characters in file names when using NTFS: U+0000 (NUL) / (slash) : (colon) * (asterisk) ? (Question mark) " (quote) < (less ...


2

Try using the -p argument to create the parent directories as needed. -p, --parents no error if existing, make parent directories as needed


2

Just a small addition to previous answer : If you started on a command line machine, or a headless system (like a rpi for example), device will probably not mount automatically. You then should first search for his device name (sudo fdisk -l) and then mount it in an empty folder (sudo mount /dev/sdb1 /media/myNewlyCreatedFolder)


2

The topic that you're looking for is mounting . In the file manager you just click on the button to open it or detach the drive, but behind the scenes it uses udisksctl . Big advantage of this command is that it mounts as your user, and you don't have to specify whole lot of options, unlike the classic mount command. For instance, to mount your usb drive, ...


2

All files inside /usr/share/applications are owned by root:root. Here's the proof: % sudo find /usr/share/applications ! \( -user root -a -group root \) % So to fix that just run: sudo chown -R root:root /usr/share/applications


1

And if you don't want to use the -p option, you could type: mkdir ~/test ~/test/panda ~/test/panda/fat


1

Try hdiutil convert -format UDRW -o <distnation-name> <source-name> This worked for me. Note that the destination comes before the source.


1

http://www.gnu.org/software/coreutils/manual/html_node/What-information-is-listed.html#index-verbose-ls-format ‘b’ block special file ‘c’ character special file


1

Now, for repairing your current system, you can do: Boot to a Live environment. Mount your current Ubuntu partition: sudo mount /dev/sdXY /mnt Change XY to your current Ubuntu partition. If unsure launch Gparted from live environment and look for something like sda1, sda2, sda3, etc. Copy the /etc back to its place i.e., /mnt/path/to/moved/etc to ...


1

USB media are normally mounted at /media go there in your terminal with cd /media && ls now you should see all storage mounted in that directory. If your device is in the list use cd to change in that directory and use ls or ll to list the files in your hdd. If the hdd is not listed open your file Browser and usectrl+ l to go in the adress bar. ...



Only top voted, non community-wiki answers of a minimum length are eligible