General :: What Does Mkdir -p Flag Do
Jul 19, 2010What does the mkdir -p flag do? i.e the '-p' part?
View 1 RepliesWhat does the mkdir -p flag do? i.e the '-p' part?
View 1 RepliesI've written a program which creates a directory using the system call mkdir()
How can i execute 'mkdir -v' using this system call? is there another system call to include options?
How do I make a directory with the date in this format:
YYYYMM
201005
I have a problem with creating folders with parametr -p. I have script like: mkdir -p /dir1/dir2/dir3/dir4, but if for example /dir1/dir2 is a file, then mkdir is stoped. how to rewrite file dir2 to directory?
View 3 Replies View Relatedim trying to implements mercurial repositories using ssh access.The problem is that if a login via ssh with the user "userA" all file upload vi that user are created with the owner: userA:userA and i need to use the group of the parent directory... is that posible ?For example:
repos ( root:repo)
-> project1 ( root:repoPrj1 )
-> file1 ( userA:usearA ) -> here i want userA:repoPrj1
I just rebuilt my system from cd CentOS5.5
Went to make a dir and got this...
The command took a while to come back. I googled it but nothing came back.
Could this be hadw error? The drive is new. I was able to issue the command again and have it work.
The setup ( although dont trust anything I say ):
I'm working on an embedded system device using a NFS mounted rootfs ( as shared by my host ) , but I store large video content directly on the device's hdd in /data.
Device's hdd partition /dev/sda3 is ext3 fs mounted at /tmp/mnt/diska3 (rw), then I have a script create dirs like /tmp/mnt/diska3/data and /tmp/mnt/diska3/data/incoming, then symlink :
ln -s /tmp/mnt/diska3/data /data so that the /data appears like any other directory.
I can see /tmp/mnt/diska3/data/incoming. I did chmod -R a+w tmp to rule out permissions.
Running a subsequent script calls mkdir: mkdir -p /data/incoming/gui
BUT fails: mkdir: cannot create directory '/data/': No such file or directory
I cannot mkdir on an ancillary HDD
[Code].....
"You'll probably want to operate from inside your home directory. If your user is (for example) username, your home directory will be /home/username/. For the rest of this section we will assume you have downloaded your zip file to /home/username/src. If you do not have a src directory, you can create it with the following "mkdir" (make directory) command:"
Where do the commands go? I cant make it work in terminal. How do I get back to "home" from where i am now? example /home/mydesktop/. I am working in mydesktop. I have downloaded some packages that pkcon search will not find, but when I try to install them using "synaptic" it cant find the packages i dl. So I found this tutorial.
"So, we have our source package in /home/username/src/.
Change to the /home/username/src/ directory with the "cd" (change directory) command like so: cd /home/username/src/
but I dont know where to write the commands.
I was to set up a cronjob that sends its output to a logfile, i want that log file to be unique. the easiest way to set this up would be to make the directory in the script, then output the command to that directory, they call that directory via is full path in cron (because cron only uses full path names.
This does not work
keep in mind the command "/bin/mkdir -p /tmp/pw_log/`date +20%y%m%d_%H%M%S`.log" works fine on the command line - but once I put it in the shell, it does not work.
Code:
This won't work in a script but it WILL work on the commandline...
Here is my output when I try the script:
Code:
Also, what is the at the end of the path in the error?
What does the -i flag mean in rm i my_file?
View 2 Replies View RelatedIn another forum (I each day visit a lot of them) a user was stating that you need to set a boot flag to make the root partition bootable, if you create partitions with GParted in order to install a Linux with GRUB2. Another was suggesting that, if you install Linux with GRUB2, the installer automatically sets a boot flag to the root partition to make it bootable (I don't remember the names). I neither believe the first nor the second thesis and I'm hoping that in this excellent forum some Gurus not only are saying I'm right but also give a comprehensive answer.
View 2 Replies View RelatedI just bought an Eee Box with Red Flag Linux Desktop 5.0NE. My intention was to use it as a backup server at home to backup files and photos, etc.
How to I get to a graphical user interface so I can start to know what I'm doing?
When I switch on the machine, it says:
Red Flag Desktop 5.0NE
Kernel 2.6.21.0-22 on an i686
localhost login:
I found that this tests if a give filename is a directory or not:
Code:
-d "$FILENAME"
But what test for not a directory? I tried
Code:
-D "$FILENAME"
But this doesnt work?
I have a created an ext3 partition and when i tried to set is hidden flag, there seems no effect. how to set the hidden flag of an ext3 partition?
View 1 Replies View RelatedI'm trying to create a shell script to take an argument and use it to name a terminal tab. So if the script's name is tabnm, tabnm "test" should rename the current tab "test"
This is my code:
#!/bin/sh
echo -ne "e]1;$1a"
but when i run it I get this output:
robin@icarus $ sh tabnm.sh test
-ne e]1;test
If I just run echo -ne "e]1;Testa" straight in the shell, the tab is renamed.
I am using Rsync to backup files to a another machine, the users on my fileserver do not exist on the backup server so Rsync throws errors about the permissions. It copies the files fine but I want to get rid of the errors and have Rsync ignore the permissions when backing up.
/backup is a mounted ftp directory
Below is the current command and output:
Code:
root@Fileserver:~# rsync -av --delete /shared/fileshare/ /backup/backup
building file list ... done
created directory /backup/backup
./
manager/ .....
rsync: chown "/backup/backup/manager/.chironfs.txt.c6MbJ7" failed: Operation not permitted (1)
rsync: chown "/backup/backup/manager/.cronman.txt.hdBG4P" failed: Operation not permitted (1) .....
sent 211115 bytes received 274 bytes 7686.87 bytes/sec
total size is 210263 speedup is 0.99
rsync error: some files could not be transferred (code 23) at main.c(977) [sender=2.6.9]
I installed cygwin with rsync on a Win XP Machine. My goal is to backup a folder from one hard drive to another (both on XP machine).
I run the following command from a batch file:
Works fine except the --delete flag is not working. Copies everything in source to destination, but doesn't delete some extra files that are present on the destination, but aren't on the source, which it's supposed to. I looked at the rsync man page, and I'm doing everything right... such as not using wildcard.
The same command works perfect on another computer (XP machine; source and dest both on XP machine).
i would like to create a script that calls a command with a flag....
/usr/bin/wget
calling
"curl -O"
[code]....
I have tried to install both wubi ubuntu and linux mint8 both times they start I see the new desktop briefly then I get a "no signal" flag on my display But I can hear the startup chime as the program finishes loading!
View 1 Replies View RelatedSearching syslog to diagnose other problems I encountered this line. As near as I can tell it has nothing to do with any problem I have.
View 2 Replies View RelatedI am a student studying computer science course.
Well, I am facing problem when doing lab questions.
I must use DLXLinux bundled in Bochs (bochs.sourceforge.net).
I am required to use the /usr/local directory.
In /usr directory, there is no directory named 'local' but there is one thing called 'local@'. So, when I try to use mkdir command to create 'local' directory in /usr , there are error "cannot make directory.....".
Look at my screenshot at [url].
PC1 and PC2 are linux pc's with linux 2.4 (or) 2.6 kernel installed on it.Observations are done on both 2.4 kernel and 2.6 kernel Problem explination:
1)PC1 "ifconfig eth1 down" on linux shell.
2)Check the "ifconfig eth1" on PC2
3) The running flags are unset first(disappear)and set(Re-appear) on the eth1 interface on PC2.
4) unset and set toggling happens with in short period of time about 1 or 2 secs.
This is clearly observed in linux 2.4 kernel with some time delay for the toggling, but 2.6 kernel this will happen every quickly..
[Code]..
Is there a flag or option to discard case sensitivity to find whether package is installed or not?
from http://www.rpm.org/max-rpm/s1-rpm-query-parts.html
Quote:
Note, however, that RPM is a bit picky about specifying package names. Here are some queries for the C library that won't work:
Code:
rpm -q libc-5.2.1
Let say I want to find out whether PyQt is installed or not but not sure the exact case, i.e. pyqt or Pyqt or ....
is there a way to find whether a package is installed or not without knowing its case exactly?
How to write a mkdir with -p option. I am struggling for creating subfolders. the chdir() is not working and thus subdirectories can't be created.
Code:
On a ubuntu 9.10 server. The problem is that when I try to mkdir in /var/local/ it says th disk is full but running df -h outputs:
Code:
I cannot see what's eating up my space in /var.
I am working on a bash script which among its operations creates directories using the mkdir command. However, when the directory already exists mkdir mentions that in the command line output.
Is there any way I can make mkdir silently overwrite any existent directory? (no messages in the output). For the same price, could it be done with other commands such as cp or mv?
I am working on SUSE 9 Server in which I am trying to make folder transferdata under /opt folder but it is throwing an error mkdir: cannot create directory `transferdata': Permission denied
View 2 Replies View RelatedHow can we fire a shell command like ls,./a.out automatically in kernel space via a kernel module ? i.e. replacement of system() function of user space into kernel space.We need to develop a kernel module which can fire some shell command let say "firefox [url]" automatically to open google automatically from module.
View 2 Replies View Related