in Education by
I would like to know is there any command/expression to get only the file name in hadoop. I need to fetch only the name of file, when I do hadoop fs -ls it prints the whole path. I tried below but just wondering if some better way to do it. hadoop fs -ls |cut -d ' ' -f17 Select the correct answer from above options

1 Answer

0 votes
by
 
Best answer
Try the command below and get the file names only: $ hdfs dfs -ls /user | awk -F'/' '{print $NF}' For more information regarding Hadoop, refer to the following video tutorial:

Related questions

0 votes
    I tried moving the files using WinSCP, but it didn't help. So, I wanna know how can I copy files from ... local computer file system. Select the correct answer from above options...
asked Jan 21, 2022 in Education by JackTerrance
0 votes
    Are they same? In my view "hadoop fs" command shows the hdfs files and the "hdfs dfs" command shows the local files, why is that? Select the correct answer from above options...
asked Jan 21, 2022 in Education by JackTerrance
0 votes
    How can I find the size of a directory, using Hadoop? Select the correct answer from above options...
asked Jan 21, 2022 in Education by JackTerrance
0 votes
    Can someone tell me what is the basic difference between HBase and Hadoop? I have done my own research but I ... in Layman terms. Select the correct answer from above options...
asked Jan 20, 2022 in Education by JackTerrance
0 votes
    The Hadoop list includes the HBase database, the Apache Mahout ________ system, and matrix operations. ... recognition 3. Statistical classification 4. Artificial intelligence...
asked Dec 7, 2022 in Education by JackTerrance
0 votes
    I run hive query by java code. Example: "SELECT * FROM table WHERE id > 100" How to export result to hdfs file.a Select the correct answer from above options...
asked Jan 28, 2022 in Education by JackTerrance
0 votes
    I have data regarding gender of people under 8 columns: mem1;mem2;mem3;mem4;mem5;mem6;mem7;mem8 MALE; ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 14, 2022 in Education by JackTerrance
0 votes
    I have an image with horizontal and vertical lines. In fact, this image is the BBC website converted to ... rectangle. Thanks! Select the correct answer from above options...
asked Jan 29, 2022 in Education by JackTerrance
0 votes
    I am new to TensorFlow. While I am reading the existing documentation, I found the term tensor really confusing. ... types of tensors? Select the correct answer from above options...
asked Jan 29, 2022 in Education by JackTerrance
0 votes
    I have uploaded a Directory to hadoop cluster that is having "," in its name like "MyDir, Name" when I ... such kind of Directories. Select the correct answer from above options...
asked Jan 28, 2022 in Education by JackTerrance
0 votes
    I want to put my Results of a hiveql query into a CSV file. How can I do it? I tried doing this, but ... select goods from the table; Select the correct answer from above options...
asked Jan 21, 2022 in Education by JackTerrance
0 votes
    Is there any way or any command which I can use in command prompt to know the version of Hadoop? Also, how ... the version of Hive? Select the correct answer from above options...
asked Jan 21, 2022 in Education by JackTerrance
0 votes
    Can anyone tell me how to learn Hadoop? Select the correct answer from above options...
asked Jan 10, 2022 in Education by JackTerrance
0 votes
    To access the services of the operating system, the interface is provided by the ___________ 1. Library 2. System calls 3. Assembly instructions 4. API...
asked Dec 7, 2022 in Education by JackTerrance
0 votes
    In OS which of the following is/are CPU scheduling algorithms? 1. Priority 2. Round Robin 3. Shortest Job First 4. All of the mentioned...
asked Dec 7, 2022 in Education by JackTerrance
...