Jump to content


  • Content Count

  • Joined

  • Last visited

Community Reputation

0 Neutral

About mandri

  • Rank
    New Here
  1. I tried and got this? $ rename.pl 's/[0-9]+-//g' * /usr/bin/rename.pl: line 4: =: command not found /usr/bin/rename.pl: line 5: syntax error near unexpected token `@ARGV' /usr/bin/rename.pl: line 5: `chomp(@ARGV = <STDIN>) unless @ARGV;' $
  2. This isn't working for me? I have perl base installed so I'm not sure why it isn't working. Does the command work for you? If it works for you,then I'll have to investigate what I may be missing related to perl. I followed the link and it is better than most I have found. I have been researching how to do this one task using rename for several days now. This has proved most difficult.
  3. Thanks for replying. I did miss the fact that a space was being substituted. I tried putting the "'s together like this "" instead of this " ",and that gave unwanted results. I still can't figure out a few things now. For experimenting,I created 3 directories named 01-test_rename_a 02-test_rename_b 03-test_rename_c I used this rename "-test_" " " * That removed what I wanted OK. What I can't figure out is how to remove 01,02,03. How do you use a wildcard here to remove these numbers? Also,if I use this,just for experimenting purposes, rename "_" " " * it only removes the first instance of _. How can I get it to remove all instances of _? Example.Change this, 01 remove_all_underscores_1 02 remove_all_underscores_2 03 remove_all_underscores_3 to this? remove all underscores 1 remove all underscores 2 remove all underscores 3 Do you know of a webpage that gives a lot of examples for the rename command? man rename in terminal didn't tell me much at all.
  4. Could you explain what the " " * after the "%%20" does? I have been playing with this some with some success. I am only guessing here,and would be grateful is someone corrects me if I'm wrong. I am guessing that in this part,"%%20",what is inside the first set of quotes is what is to be renamed. Then in this part " " *,what is inside the second set of quotes is what it is to be renamed to. Since there is nothing inside the quotes in the second part,it will be renamed nothing,which in turn is actually just removing the first part. The * is saying to do this for all the files found to contain %%20 in the directory this command was entered in. Am I right?
  5. Yes,I now see what you mean. That is what had me confused.As far as I knew,I didhave a file named test.txt. I had only created a new text file,and named it test. Not test.txt as in your example. I assumed a text file would automatically be given the file extension .txt. I do have to stop assuming things like this. Since I've see that your example does work,I have yet tried two more deviations from the example you have given,using the file named test.txt. Both have also worked. 1.zip -e test test.txt This gave the same result,a zip file named test.zip 2.zip -e file test.txt This gave the zip file the name file.zip rather than test.zip So do I have this right now? 1.The first parameter is what you want the zip file to be named,and the second(and additional) parameter(s) is the file(s) you want to zip. 2.It's not necessary to specify .zip in the first parameter,as my above examples did work,because Zip will give it the .zip extension anyway. Thanks for your time and being persistant with me. I now have to get a new keyboard. The letter z is worn off.
  6. I did try as you suggested,but it didn't work.Sorry. :P cd Desktop Desktop]$ zip -e test.zip test.txt Enter password: Verify password: zip warning: name not matched: test.txt zip error: Nothing to do! (test.zip) So I tried random entries until I found this one that did. cd Desktop Desktop]$ zip -e test test Enter password: Verify password: adding: test (deflated 50%) Desktop]$ Once I found that this worked,adding the option -r included all the files and sub-directories in a more complex scenario. That is a fine idea,no need for mcrypt. :)
  7. OK.I got it!Kind of. :D I kept messing with this until I found something that worked. OK.I did read a lot too!!! Using this command cd Desktop Desktop]$ zip -e -r test.zip test test Enter password: Verify password: adding: test/ here it added everything found in the directory named test,all the subdirectories,text files,everything That created a password protected zip file named test.zip. Now when I want to extract the file,it asks for the password,That's good. Even with using ark,if I want to open any file within the archive,it asks for the password.That's good. Only one problem left. That is when using ark,the archive will still open and all the file names are readily available,and listed in a tree view,even if you can't open the individual files to see their content without the password. How can I prevent ark from even opening the archive at all without the password? I suppose if all the file names were changed to something else that didn't identify the contents before they were archived,it wouldn't matter if the file names were easily exposed. That is yet another matter,and I think I'd be getting off course taking that route. This isn't a top secret experiment here. I could just as easily encrypt it with gpg if that were the case. Any ideas anyone? If not,I'll keep working at this,and post what I've found,if I find anything. Thanks. EDIT
  8. I am still not getting nowhere with this. I have tried this as well xxxx]$ cd /home/mandri/Desktop/test test]$ zip -e >/home/mandri/Desktop/test.zip That accepts the password,and creates a zip archive on my desktop. The terminal just stalls at the line adding: - and the zip archive remains at 0 bytes. I also tried this cd Desktop Desktop]$ zip -e test >test bash: test: Is a directory So I then tried this Desktop]$ zip -e test >test.zip Enter password: Verify password: zip warning: missing end signature--probably not a zip file (did you zip warning: remember to use binary mode when you transferred it?) zip error: Zip file structure invalid (test.zip) I also tried this Desktop]$ zip -e test >test/* bash: test/*: ambiguous redirect Then this Desktop]$ zip -e test/* >test.zip Enter password: Verify password: This seemed to finish,and it created a zip archive on my desktop,and I didn't see it stall at adding: - like earlier. But the zip archive is still 0 bytes.There's nothing in it. I should add because you gave examples of .txt,I am trying to zip an entire directory(a folder containing a few other folders)one folder with wallpapers,another folder with pictures from my camera,and also including text files within the parent directory,which is /home/mandri/Desktop/test And oh yeah,I'm getting so caught up in this,I almost forgot to say thanks for replying. So THANKS. :) EDIT I seen there was a file size of 118 bytes,not near enough for the wallpapers and .jpegs. When I try to open it,I get the error "Could not open the file, probably due to an unsupported file format". Using ark,I get "an error occured when trying to open the archive". I have since tried this too,no luck. cd Desktop Desktop]$ zip -e -r test >test2.zip Enter password: Verify password: zip error: Nothing to do! (test.zip) Desktop]$ zip -e -R test >test2.zip Enter password: Verify password: zip error: Nothing to do! (test.zip) Desktop]$
  9. I tried to search for the answer to this,zip -e nothing to do,but I keep getting errors I only used 3 letters. Other combinations of those keywords gave very irrelevant results. Simple question. How do I create and password protect a zip file? I have a directory named test on my desktop. Inside this directory are a few more directories of copied data just for this test. I opened a terminal and enter zip -e /home/mandri/Desktop/test. After entering and confirming a password,I get the error "nothing to do!". I tried opening a terminal in the directory I want to zip,I get this error. "Invalid command arguments (cannot write zip file to terminal)". What am I doing wrong here? Also,is there a way in linux to create a password protected .rar file? I can create the .rar easy enough,but how can a password be added? I also know about GPG allowing the password,but I don't want to encrypt it,just simply add a password. Thanks.
  10. How do you edit your own post? I didn't want users and nousers,but instead user and nouser. Another thing I,ve noticed. Protection is only as secure as to who has access to your computer,and not so much your files on that computer. Anybody with a live cd can read every file there is on your computer.Even on your windows partition. And even those hidden windows OS files. You can encrypt the files to further enhance your protection against someone reading them in this case.
  11. I think,as neddie has already said,that changing the entry "users" to "nousers" in fstab as root will give you the results you are looking for. users vs. nousers
  12. I tried to use the command /sbin/shutdown -c within a keyboard shortcut. First created it as a user,than also as root. Once shutdown,or reboot,is selected from the log out menu,the keyboard input is not accepted. Maybe the wrong command?If this command is issued in console,no pid of shutdown is found.So it is a valid command. I have a feeling that,being that I only have a few seconds,3 of them,to issue the command to cancel the shutdown,anything short of a script will not work. Thanks to all.
  13. In KDE that can be changed in the control center. System>system menu's?
  14. scoonma,thanks for the reply. Even one that says I'm off my rocker and it can't be done,is better than no reply at all. What you have stated does sound like what I need. First,I have two feet into something here I really do not know much about. I wouldn't be able to write a script myself.I don't think. I have a seperate install I use for experimenting with things like this unknown to me.So if I screw it up real bad,only takes 15 minutes to re-install,and I'll try it again.Only way I have to learn. First thing I tried,and it failed,was to edit inittab to this: # Trap CTRL-ALT-DELETE #ca::ctrlaltdel:/sbin/shutdown -t3 -r now (I commented this out) # Trap experiment CTRL-ALT-DELETE (And changed this to -c) ca::ctrlaltdel:/sbin/shutdown -c I had the idea,instead of figuring out how the (special) keys are addressed,to first see if -c would work with a set of keys that already was.10 steps backwards for me. Even with inittab modified as above,(yes,was saved as root)the keys cntr-alt delete still performed exactly as before.That was unexpected. I anticipated it not working at all,if nothing else. When right clicking to shutdown,the keys have no effect once(for what I believe is the reason)X has recieved the termsignal. The cntr-alt-delete sequence is calling up a GUI,same as right clicking,log out. I have to change that. Seems to be as well,for the immediate execution of the ctrl-alt-delete,it has to be done in console.Not a GUI based login. Well,if I ever get this figured out,I'll probally never use it anyway. But at least I learned something.
  15. Can any of this be implemented. X session management I'm grasping at straws here. Even a few links leading to what I'm looking for would be nice. :D
  • Create New...