Jump to content


 


Register a free account to unlock additional features at BleepingComputer.com
Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.


Click here to Register a free account now! or read our Welcome Guide to learn how to use this site.

Photo

Terminal cd command to non-root volume


  • Please log in to reply
5 replies to this topic

#1 MaryBet82

MaryBet82

  • Members
  • 454 posts
  • OFFLINE
  •  
  • Gender:Female
  • Local time:01:35 PM

Posted 18 March 2017 - 11:35 AM

Macbook pro 10.6.8

 

I'm trying to use the rm command in Terminal on a sparse file that I created accidentally on a volume on my LaCie ext HD. The volume is named MacBU2 and I used the command in Terminal "cd /MacBU2/. My prompt now says MacBook:MacBU2 and the pwd command results in /MacBU2. This volume has 4 folders and the sparse file. When I used the ls command it only lists a WinXPBU.vdi file in one of the folders.

 

I tried "ls info" [I think - whatever terminal suggested] and got into a help info that said nothing in English and also the only way I could get out was to close Terminal and start again.

 

Why isn't the ls command listing all the folders and the sparse file? Do I need a different command to list the contents of a volume vs a folder?

 

 


mac 10.6 on macbook pro
WinXP sp2 on Dell 380 w/ 512 MB RAM- currently dead in the water
WinXP tab ed sp 3 on Thinkpad X41 w/ 1.5 GB RAM - lemony flavored
Win2K Sp4 on Sony VAIO GXR600 w/ 512 MB RAM - currently blue screening

BC AdBot (Login to Remove)

 


#2 JohnC_21

JohnC_21

  • Members
  • 24,452 posts
  • OFFLINE
  •  
  • Gender:Male
  • Local time:01:35 PM

Posted 18 March 2017 - 11:45 AM

I don't have experience with a Mac but does ls -l give anything? This is the linux command for lising files/folders.  See this page and look under Core Commands for other list commands including ls -a

 

https://github.com/0nn0/terminal-mac-cheatsheet



#3 MaryBet82

MaryBet82
  • Topic Starter

  • Members
  • 454 posts
  • OFFLINE
  •  
  • Gender:Female
  • Local time:01:35 PM

Posted 18 March 2017 - 12:37 PM

Thanks for the link to that summary of commands page. I've bookmarked it for further reading.

 

So far I've tried ls -a, ls -R and ls -l. I just get that one file listed.

 

I even tried something I vaguely remember from Command Prompt - ls MIFiles.sparsebundle [the name of the file]. For this I got no such file or directory. I tried changing to one of the folders listed in Finder - "cd Firefox" and "cd /Firefox and got no such file or directory. I used Get Info on one of the folders. It's not locked and it's read/write for me as user.

 

All I can think to do is repair permissions in Disk Utility. Whenever I run that I always get a list that need repair. Someday I want to read up on mac permissions, but I've got too much troubleshooting to do right now. If that doesn't work I'm going to use Disk Utility to erase the contents of the volume. I already copied the contents to a temp folder on the mac HD. That should erase the sparsebundle file w/out putting it in Trash.


Edited by MaryBet82, 18 March 2017 - 01:10 PM.

mac 10.6 on macbook pro
WinXP sp2 on Dell 380 w/ 512 MB RAM- currently dead in the water
WinXP tab ed sp 3 on Thinkpad X41 w/ 1.5 GB RAM - lemony flavored
Win2K Sp4 on Sony VAIO GXR600 w/ 512 MB RAM - currently blue screening

#4 JohnC_21

JohnC_21

  • Members
  • 24,452 posts
  • OFFLINE
  •  
  • Gender:Male
  • Local time:01:35 PM

Posted 18 March 2017 - 12:49 PM

What file system is on the external? If FAT32 or ntfs you could boot a live linux disk and delete the file that way.



#5 MaryBet82

MaryBet82
  • Topic Starter

  • Members
  • 454 posts
  • OFFLINE
  •  
  • Gender:Female
  • Local time:01:35 PM

Posted 18 March 2017 - 08:04 PM

My external HD is formatted w/ extended journal. It has 2 partitions - one is a SuperDuper bootable backup of all my files [BU1]. The other is a smaller partition [BU2] I use to drag and drop single files that I want to BU w/out running a whole BU program - like a BU of my Firefox bookmarks when I've added a lot of bookmarks.

 

When I ran my first SuperDuper BU the other day after awhile I somehow [I think] directed the BU to the 2nd non-bootable partition by not noticing which partition was listed in the Copy To box. It seemed to run OK, but no new files ended up in the bootable partition w/ all my files. I did end up w/ an empty folder named BU2 in my BU1 partition and the sparse file in the BU2 partition. The next time I ran the BU, this time w/ the correct partition in the Copy To box, it transferred over my new personal files but made the BU1 partition non-bootable. Whatever I did w/ that first BU changed the backup script. I guess it may also have done Something that kept Terminal from correctly IDing Folder/Files in BU2.

 

I erased both BU1 and BU2 w/ Disk Utility - thus erasing that sparse file - and ran a new BU w/ the standard SuperDuper Backup All Files script to BU1 rather than my custom script which left out a few folders. My ext HD is now bootable again. I copied back over the Folders to BU2, but I haven't tried navigating over there w/ Terminal and seeing if it will recognized the folders/files there. I've disconnected the ext. HD for the night and put it in its safe storage place. Next time I connect the ext HD I'll try navigating back over to BU2 and running the ls command.


mac 10.6 on macbook pro
WinXP sp2 on Dell 380 w/ 512 MB RAM- currently dead in the water
WinXP tab ed sp 3 on Thinkpad X41 w/ 1.5 GB RAM - lemony flavored
Win2K Sp4 on Sony VAIO GXR600 w/ 512 MB RAM - currently blue screening

#6 smax013

smax013

  • BC Advisor
  • 2,329 posts
  • OFFLINE
  •  
  • Gender:Not Telling
  • Local time:12:35 PM

Posted 18 March 2017 - 08:26 PM

It looks like you might have just gone ahead with the format of the drive and thus don't need to deal with trying to delete the sparse file anymore.

But for future reference, if you want to delete a file without sending it to the trash using the rm command in Terminal, you should be able to it this way (feel free to test on some non-important file):

1) Open a Finder window and navigate to where the file is that you want to delete (i.e. have that file listed in the Finder window). Leave that Finder window open where you will be able to get to it.

2) Open the Terminal.

3) Do not worry about navigating to the appropriate location of the File in the Terminal.

4) At the command prompt in the Terminal, type "rm -f " BUT DO NOT HIT ENTER/RETURN (and note there is a space after the "-f" portion).

5) Switch to the Finder window that contains the file you want to delete.

6) Select the file in the Finder window and then drag that file to the Terminal window. This should "paste" into the command prompt, after the previously typed "rm -f ", the full path and filename of the file you want to delete.

7) Hit Enter/Return. The file should then be gone. NOTE: This will immediately delete the file, with no "Are you sure?" type prompt...it will just be gone with not way to retrieve it without using some sort of data recovery software...so be sure you want that file gone.

And for future, future reference, El Capitan (aka 10.11) and newer supposedly has the ability to remove individual files in the Finder without first dumping them in the Trash. So, you should not need to use the Terminal for such stuff in the future when you do upgrade to El Capitan (or Sierra).




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users