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

"ls" Command Questions


  • Please log in to reply
9 replies to this topic

#1 pcpunk

pcpunk

  • Members
  • 6,259 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Florida
  • Local time:02:46 PM

Posted 11 June 2017 - 11:34 AM

Hey guys, I have a Customers 5 TB Seagate external drive and I found an inaccessible Folder on it that I wanted to delete because it is taking up tons of space.  I also wanted to view those files before Deleting them with "ls" but somehow I forget how to do this.  I looked and tried over and over to no avail. 

This conversation started here as "how to run as root" which I was able to do.

 

The Folder is called "Desktop", this is a Windows 10 machine and all the files are backed-up now.  I know some of you guys have showed me how to do this at one time bit it still alludes me.  I can't even Delete this  Folder in  Windows Under the Special Admin Account, which is really weird.

 

I understand that I can open the Terminal inside the Directory but not if I cannot get into it in the first place.

 

Here is some of the things I've tried on my own USB Storage device for practice.  Trying to get into "Linux Commands" :

chris@chris-HP-Compaq-nx7400-EN352UTR-ABA:~ > ls -a /media/chris/PURPLE32GB/Linux Commands/
ls: cannot access /media/chris/PURPLE32GB/Linux: No such file or directory
ls: cannot access Commands/: No such file or directory
chris@chris-HP-Compaq-nx7400-EN352UTR-ABA:~ > sudo ls -a chris@chris-HP-Compaq-nx7400-EN352UTR-ABA:~ > ls -a /media/chris/PURPLE32GB/Linux Commands/
[sudo] password for chris: 
ls: cannot access chris@chris-HP-Compaq-nx7400-EN352UTR-ABA:~: No such file or directory
ls: cannot access /media/chris/PURPLE32GB/Linux: No such file or directory
ls: cannot access Commands/: No such file or directory
chris@chris-HP-Compaq-nx7400-EN352UTR-ABA:~ > 

Edited by pcpunk, 11 June 2017 - 01:01 PM.

sBCcBvM.png

Created by Mike_Walsh

 

KDE, Ruler of all Distro's

eps2.4_m4ster-s1ave.aes_pcpunk_leavemehere

 


BC AdBot (Login to Remove)

 


#2 SleepyDude

SleepyDude

  • Malware Response Team
  • 3,129 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Portugal
  • Local time:07:46 PM

Posted 11 June 2017 - 01:25 PM

Hi,

 

If the path include spaces or special chars you have to escape them like this:

ls -a /media/chris/PURPLE32GB/Linux\ Commands/

if you type ls -la /m and start pressing the TAB key the console will try to autocomplete the rest of the name for you. Press the TAB key several times to cycle between the matching values or type another character.


• Please do not PM me asking for support. Post on the forums instead it will increases the chances of getting help for your problem by one of us.
• Posts in the Malware section that are not replied to within 4 days will be closed. PM me or a moderator to reactivate.
• Please post your final results, good or bad. We like to know! Thank you!

 
Proud graduate of GeekU and member of UNITE
___
Rui

 
 


#3 Gary R

Gary R

    MRU Admin


  • Malware Response Team
  • 909 posts
  • OFFLINE
  •  
  • Gender:Male
  • Local time:07:46 PM

Posted 11 June 2017 - 03:06 PM

Instead of escaping the spaces, which can be time consuming if you have a few of them in a filepath, you can enclose a whole file path with spaces with '' so that Terminal will correctly read the filepath.

 

So instead of ...

 

ls -a /media/chris/PURPLE32GB/Linux Commands/

 

You should have used ...

 

ls -a '/media/chris/PURPLE32GB/Linux Commands/'

 

 

See ... http://www.hecticgeek.com/2014/02/spaces-file-names-command-line/


Edited by Gary R, 11 June 2017 - 03:07 PM.


#4 pcpunk

pcpunk
  • Topic Starter

  • Members
  • 6,259 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Florida
  • Local time:02:46 PM

Posted 11 June 2017 - 06:20 PM

I thought that may be the problem guys, thanks.  I'll try that out when back on linux.

 

When I saw this, it got me thinking about the Space.

ls: cannot access /media/chris/PURPLE32GB/Linux: No such file or directory
ls: cannot access Commands/: No such file or directory

Thanks, I hope this will get me into that Folder to look at it, and to eventually Delete it.  It has like 46,000 files in it and is taking up valuable real-estate.  The files are all old but still want to take a look at them.


sBCcBvM.png

Created by Mike_Walsh

 

KDE, Ruler of all Distro's

eps2.4_m4ster-s1ave.aes_pcpunk_leavemehere

 


#5 GoofProg

GoofProg

  • Banned
  • 224 posts
  • OFFLINE
  •  
  • Gender:Male
  • Local time:12:46 PM

Posted 12 June 2017 - 10:17 AM

Under windows try

 attrib -r -a -s -h <folder>

Under Linux I would just give the folder all permissions in the world and get rid of it

sudo chmod +777 <folder>


#6 pcpunk

pcpunk
  • Topic Starter

  • Members
  • 6,259 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Florida
  • Local time:02:46 PM

Posted 12 June 2017 - 10:46 AM

These will be valuable tools, thank you!


sBCcBvM.png

Created by Mike_Walsh

 

KDE, Ruler of all Distro's

eps2.4_m4ster-s1ave.aes_pcpunk_leavemehere

 


#7 Gary R

Gary R

    MRU Admin


  • Malware Response Team
  • 909 posts
  • OFFLINE
  •  
  • Gender:Male
  • Local time:07:46 PM

Posted 12 June 2017 - 11:09 AM

If you're accessing files on a Windows machine by booting into Linux, then you don't need to worry about Windows' file or folder attributes, since they are not recognised by Linux.

 

By that I mean that any Windows file or folder (even system files and folders) can be deleted whilst booted into Linux.



#8 pcpunk

pcpunk
  • Topic Starter

  • Members
  • 6,259 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Florida
  • Local time:02:46 PM

Posted 12 June 2017 - 11:16 AM

Yeah Gary, that is what I will do, because this will allow me to do this on my Linux Box with his External Drive connected.


sBCcBvM.png

Created by Mike_Walsh

 

KDE, Ruler of all Distro's

eps2.4_m4ster-s1ave.aes_pcpunk_leavemehere

 


#9 SleepyDude

SleepyDude

  • Malware Response Team
  • 3,129 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Portugal
  • Local time:07:46 PM

Posted 12 June 2017 - 11:22 AM

I thought that may be the problem guys, thanks.  I'll try that out when back on linux.

 

When I saw this, it got me thinking about the Space.

ls: cannot access /media/chris/PURPLE32GB/Linux: No such file or directory
ls: cannot access Commands/: No such file or directory

Thanks, I hope this will get me into that Folder to look at it, and to eventually Delete it.  It has like 46,000 files in it and is taking up valuable real-estate.  The files are all old but still want to take a look at them.

 

Is the device mounted on /media?


• Please do not PM me asking for support. Post on the forums instead it will increases the chances of getting help for your problem by one of us.
• Posts in the Malware section that are not replied to within 4 days will be closed. PM me or a moderator to reactivate.
• Please post your final results, good or bad. We like to know! Thank you!

 
Proud graduate of GeekU and member of UNITE
___
Rui

 
 


#10 pcpunk

pcpunk
  • Topic Starter

  • Members
  • 6,259 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Florida
  • Local time:02:46 PM

Posted 12 June 2017 - 05:05 PM

Yes SleepyDude, this is a Test I was doing to prepare to Read and eventually Delete a Folder on an External Drive.  That "media" is leading to my USB, which you will see as "PURPLE32GB"

chris@chris-HP-Compaq-nx7400-EN352UTR-ABA:~ > ls -a /media/chris/PURPLE32GB/Linux Commands/

sBCcBvM.png

Created by Mike_Walsh

 

KDE, Ruler of all Distro's

eps2.4_m4ster-s1ave.aes_pcpunk_leavemehere

 





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users